]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Allow old WAL recycling during REPACK CONCURRENTLY
authorÁlvaro Herrera <alvherre@kurilemu.de>
Fri, 29 May 2026 22:23:25 +0000 (00:23 +0200)
committerÁlvaro Herrera <alvherre@kurilemu.de>
Fri, 29 May 2026 22:23:25 +0000 (00:23 +0200)
commit45b02984e2fa9ee7bd83f7e58797b160baf0cc13
tree6987c2ae1ee79978cce455ea0f03dcffdce442ea
parent08127c641c099b21480d4cd47c2706fe64ca1820
Allow old WAL recycling during REPACK CONCURRENTLY

During REPACK CONCURRENTLY, logical decoding keeps replication
slot.restart_lsn pinned behind the oldest running transaction, which is
often the long-lived REPACK transaction itself. As a result, old WAL
segments are retained longer than necessary.

This commit advances the replication slot each time WAL insertion
crosses a segment boundary, so obsolete WAL files can be recycled while
REPACK is still running.

Author: Zhijie Hou <houzj.fnst@fujitsu.com>
Reviewed-by: Antonin Houska <ah@cybertec.at>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Discussion: https://postgr.es/m/TY4PR01MB17718B44164522D0798F8E898940A2@TY4PR01MB17718.jpnprd01.prod.outlook.com
src/backend/commands/repack_worker.c