Re: Spurious "apparent wraparound" via SimpleLruTruncate() rounding
Noah Misch <noah@leadboat.com>
From: Noah Misch <noah@leadboat.com>
To: Andrey Borodin <x4mmm@yandex-team.ru>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, pgsql-hackers@postgresql.org
Date: 2021-01-01T20:35:04Z
Lists: pgsql-hackers
On Fri, Jan 01, 2021 at 11:05:29PM +0500, Andrey Borodin wrote: > I've found this thread in CF looking for something to review. Thanks for taking a look. > > 9 нояб. 2020 г., в 09:53, Noah Misch <noah@leadboat.com> написал(а): > > > > Rebased both patches, necessitated by commit c732c3f (a repair of commit > > dee663f). As I mentioned on another branch of the thread, I'd be content if > > someone reviews the slru-truncate-modulo patch and disclaims knowledge of the > > slru-truncate-insurance patch; I would then abandon the latter patch. > > <slru-truncate-modulo-v5.patch><slru-truncate-t-insurance-v4.patch> > > Commit c732c3f adds some SYNC_FORGET_REQUESTs. > slru-truncate-modulo-v5.patch fixes off-by-one error in functions like *PagePrecedes(int page1, int page2). > slru-truncate-t-insurance-v4.patch ensures that off-by-one errors do not inflict data loss. > > While I agree that fixing error is better than hiding it, I could not figure out how c732c3f is connected to these patches. > Can you please give me few pointers how to understand this connection? Commit c732c3f is the last commit that caused a merge conflict. There's no other connection to this thread, and one can review patches on this thread without studying commit c732c3f. Specifically, this thread's slru-truncate-modulo patch and commit c732c3f modify adjacent lines in SlruScanDirCbDeleteCutoff(); here's the diff after merge conflict resolution: --- a/src/backend/access/transam/slru.c +++ b/src/backend/access/transam/slru.c @@@ -1525,4 -1406,4 +1517,4 @@@ SlruScanDirCbDeleteCutoff(SlruCtl ctl, - if (ctl->PagePrecedes(segpage, cutoffPage)) + if (SlruMayDeleteSegment(ctl, segpage, cutoffPage)) - SlruInternalDeleteSegment(ctl, filename); + SlruInternalDeleteSegment(ctl, segpage / SLRU_PAGES_PER_SEGMENT);
Commits
-
Prevent excess SimpleLruTruncate() deletion.
- c424c75f5382 9.5.25 landed
- 9afba9b0e282 10.16 landed
- 677f6cb1d987 11.11 landed
- 66087f7e922c 12.6 landed
- 1a31d8c52db4 9.6.21 landed
- 6eb3fc7fcd89 13.2 landed
- 6db992833c04 14.0 landed
-
Fix unlinking of SLRU segments.
- c732c3f8c122 14.0 cited
-
Defer flushing of SLRU files.
- dee663f78439 14.0 cited
-
Change XID and mxact limits to warn at 40M and stop at 3M.
- cd5e82256de5 14.0 cited