pgsql: Prevent excess SimpleLruTruncate() deletion. - Mailing list pgsql-committers

From Noah Misch
Subject pgsql: Prevent excess SimpleLruTruncate() deletion.
Date
Msg-id E1l0s5U-0002N4-1C@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Prevent excess SimpleLruTruncate() deletion.

Every core SLRU wraps around.  With the exception of pg_notify, the wrap
point can fall in the middle of a page.  Account for this in the
PagePrecedes callback specification and in SimpleLruTruncate()'s use of
said callback.  Update each callback implementation to fit the new
specification.  This changes SerialPagePrecedesLogically() from the
style of asyncQueuePagePrecedes() to the style of CLOGPagePrecedes().
(Whereas pg_clog and pg_serial share a key space, pg_serial is nothing
like pg_notify.)  The bug fixed here has the same symptoms and user
followup steps as 592a589a04bd456410b853d86bd05faa9432cbbb.  Back-patch
to 9.5 (all supported versions).

Reviewed by Andrey Borodin and (in earlier versions) by Tom Lane.

Discussion: https://postgr.es/m/20190202083822.GC32531@gust.leadboat.com

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c424c75f5382c43ed334e7bb4f74cbfea4425df5

Modified Files
--------------
src/backend/access/transam/clog.c      |  27 +++++--
src/backend/access/transam/commit_ts.c |  34 +++++---
src/backend/access/transam/multixact.c |  38 +++++----
src/backend/access/transam/slru.c      | 143 +++++++++++++++++++++++++++++----
src/backend/access/transam/subtrans.c  |  17 ++--
src/backend/commands/async.c           |   7 +-
src/backend/storage/lmgr/predicate.c   | 109 +++++++++++++++++++++----
src/include/access/slru.h              |  16 +++-
8 files changed, 312 insertions(+), 79 deletions(-)


pgsql-committers by date:

Previous
From: Noah Misch
Date:
Subject: pgsql: Fix pg_dump for GRANT OPTION among initial privileges.
Next
From: Jeff Davis
Date:
Subject: pgsql: Documenation fixups for replication protocol.