pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Prevent underflow in KeepLogSeg().
Date: Thu, 27 Apr 2023 21:39:54 +0000
Message-ID: <E1ps9LF-005ECG-6K@gemulon.postgresql.org> (raw)

Prevent underflow in KeepLogSeg().

The call to XLogGetReplicationSlotMinimumLSN() might return a
greater LSN than the one given to the function.  Subsequent segment
number calculations might then underflow, which could result in
unexpected behavior when removing or recyling WAL files.  This was
introduced with max_slot_wal_keep_size in c655077639.  To fix, skip
the block of code for replication slots if the LSN is greater.

Reported-by: Xu Xingwang
Author: Kyotaro Horiguchi
Reviewed-by: Junwang Zhao
Discussion: https://postgr.es/m/17903-4288d439dee856c6%40postgresql.org
Backpatch-through: 13

Branch
------
master

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

Modified Files
--------------
src/backend/access/transam/xlog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1ps9LF-005ECG-6K@gemulon.postgresql.org>
Permalink:  ../E1ps9LF-005ECG-6K@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ps9LF-005ECG-6K@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: nathan@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Prevent underflow in KeepLogSeg().
  In-Reply-To: <E1ps9LF-005ECG-6K@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