Re: Spurious "apparent wraparound" via SimpleLruTruncate() rounding

From: Noah Misch <noah(at)leadboat(dot)com>
To: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Spurious "apparent wraparound" via SimpleLruTruncate() rounding
Date: 2021-01-02 10:00:34
Message-ID: 20210102100034.GA2223849@rfd.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Luc Vlaming 2021-01-02 10:04:37 Re: faster ETL / bulk data load for heap tables
Previous Message Thomas Munro 2021-01-02 09:50:55 Re: pgbench: option delaying queries till connections establishment?