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

Noah Misch <noah@leadboat.com>

From: Noah Misch <noah@leadboat.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, pgsql-hackers@postgresql.org
Date: 2020-09-30T07:14:26Z
Lists: pgsql-hackers
On Wed, Sep 30, 2020 at 03:06:40PM +0900, Michael Paquier wrote:
> On Sun, Sep 06, 2020 at 08:14:21PM -0700, Noah Misch wrote:
> > http://cfbot.cputube.org/patch_29_2026.log applies the two patches in the
> > wrong order.  For this CF entry, ignore it.
> 
> OK, thanks.  This is a bug fix, so I have moved that to the next CF
> for now.  Noah, would you prefer more reviews or are you confident
> enough to move on with this issue?

The former.  I plan to wait until a review puts this in Ready for Committer.

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.  I'm not fond of how the latter turned out, particularly the
unintended consequence in TruncateMultiXact().  (See the commit message and/or
the edit to the comment in TruncateMultiXact().)  The subtle interaction with
SerialAdd() is not great, either.



Commits

  1. Prevent excess SimpleLruTruncate() deletion.

  2. Fix unlinking of SLRU segments.

  3. Defer flushing of SLRU files.

  4. Change XID and mxact limits to warn at 40M and stop at 3M.