pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: Andrey Borodin <x4mmm@yandex-team.ru>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Spurious "apparent wraparound" via SimpleLruTruncate() rounding
Date: Sat, 2 Jan 2021 02:00:34 -0800
Message-ID: <20210102100034.GA2223849@rfd.leadboat.com> (raw)
In-Reply-To: <25719B7D-080D-45C6-9A62-2320D8E6DFC7@yandex-team.ru>
References: <20200330052809.GB2324620@rfd.leadboat.com>
	<1959.1586198769@sss.pgh.pa.us>
	<20200407041847.GA519993@rfd.leadboat.com>
	<20200525070033.GA1591335@rfd.leadboat.com>
	<20200830053433.GA3275593@rfd.leadboat.com>
	<20201029040159.GA3803708@rfd.leadboat.com>
	<20201109045319.GA459206@rfd.leadboat.com>
	<23599722-1EFF-4B71-A77C-67141882EFAE@yandex-team.ru>
	<20210101203504.GB2156654@rfd.leadboat.com>
	<25719B7D-080D-45C6-9A62-2320D8E6DFC7@yandex-team.ru>

On Sat, Jan 02, 2021 at 12:31:45PM +0500, Andrey Borodin wrote:
> Do I understand correctly that this is bugfix that needs to be back-patched?

The slru-truncate-modulo patch fixes a bug.  The slru-truncate-t-insurance
patch does not.  Neither _needs_ to be back-patched, though I'm proposing to
back-patch both.  I welcome opinions about that.

> Thus we should not refactor 4 identical *PagePrecedes(int page1, int page2) into 1 generic function?

I agree with not refactoring that way, in this case.

> Since functions are not symmetric anymore, maybe we should have better names for arguments than "page1" and "page2"? At least in dev branch.

That works for me.  What names would you suggest?

> Is it common practice to embed tests into assert checking like in SlruPagePrecedesUnitTests()?

No; it's neither common practice nor a policy breach.





view thread (33+ messages)  latest in thread

Message-ID: <20210102100034.GA2223849@rfd.leadboat.com>
Permalink:  ../20210102100034.GA2223849@rfd.leadboat.com/
Also on:    postgresql.org/message-id/20210102100034.GA2223849@rfd.leadboat.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: noah@leadboat.com, x4mmm@yandex-team.ru, tgl@sss.pgh.pa.us, tomas.vondra@2ndquadrant.com
  Subject: Re: Spurious "apparent wraparound" via SimpleLruTruncate() rounding
  In-Reply-To: <20210102100034.GA2223849@rfd.leadboat.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox