pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Prevent underflow in KeepLogSeg().
4+ messages / 1 participants
[nested] [flat]

* pgsql: Prevent underflow in KeepLogSeg().
@ 2023-04-27 21:39  Nathan Bossart <nathan@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Nathan Bossart @ 2023-04-27 21:39 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_15_STABLE

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

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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Prevent underflow in KeepLogSeg().
@ 2023-04-27 21:39  Nathan Bossart <nathan@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Nathan Bossart @ 2023-04-27 21:39 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Prevent underflow in KeepLogSeg().
@ 2023-04-27 21:39  Nathan Bossart <nathan@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Nathan Bossart @ 2023-04-27 21:39 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/137003036972be4895ccdf802c640d037a5e607e

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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Prevent underflow in KeepLogSeg().
@ 2023-04-27 21:39  Nathan Bossart <nathan@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Nathan Bossart @ 2023-04-27 21:39 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_13_STABLE

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

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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2023-04-27 21:39 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-04-27 21:39 pgsql: Prevent underflow in KeepLogSeg(). Nathan Bossart <nathan@postgresql.org>
2023-04-27 21:39 pgsql: Prevent underflow in KeepLogSeg(). Nathan Bossart <nathan@postgresql.org>
2023-04-27 21:39 pgsql: Prevent underflow in KeepLogSeg(). Nathan Bossart <nathan@postgresql.org>
2023-04-27 21:39 pgsql: Prevent underflow in KeepLogSeg(). Nathan Bossart <nathan@postgresql.org>

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