pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Prevent excess SimpleLruTruncate() deletion.
Date: Sat, 16 Jan 2021 20:22:20 +0000
Message-ID: <E1l0s5U-0002My-0I@gemulon.postgresql.org> (raw)

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_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1a31d8c52db4220f162ed3c4812569843daf950e

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(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1l0s5U-0002My-0I@gemulon.postgresql.org>
Permalink:  ../E1l0s5U-0002My-0I@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1l0s5U-0002My-0I@gemulon.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: noah@leadboat.com
  Subject: Re: pgsql: Prevent excess SimpleLruTruncate() deletion.
  In-Reply-To: <E1l0s5U-0002My-0I@gemulon.postgresql.org>
  References: <E1l0s5U-0002My-0I@gemulon.postgresql.org>

* 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