pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Avoid delaying WAL receiver shutdown while draining WAL
6+ messages / 1 participants
[nested] [flat]

* pgsql: Avoid delaying WAL receiver shutdown while draining WAL
@ 2026-11-19 04:30 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-11-19 04:30 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid delaying WAL receiver shutdown while draining WAL

Standby shutdown, promotion, and changes to replication connection
settings could be delayed while the WAL receiver was continuously
receiving WAL.

The inner receive loop in WalReceiverMain() processed all immediately
available messages without checking interrupts. If WAL arrived faster
than the receiver could write it, the receiver could remain in this
loop with SIGTERM pending, leaving the startup process waiting for it
to exit.

Fix this by checking interrupts on each iteration of the inner loop so
that pending shutdown requests are handled even when more WAL is
available.

Backpatch to all supported versions.

Reported-by: Andres Freund <andres@anarazel.de>
Author: Nitin Jadhav <nitinjadhavpostgres@gmail.com>
Reviewed-by: Joao Rito <joaovictor.rito@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/20210511022755.wcb5h4czadxsgewt@alap3.anarazel.de
Discussion: https://postgr.es/m/CAMm1aWY-bps8VPCdyTTZo6NZicSRrq0kBArzjKTZoKHdN_wqOA@mail.gmail.com
Backpatch-through: 15

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5c06a7ef24c70226db22310b4c6bad546b6f3335

Modified Files
--------------
src/backend/replication/walreceiver.c | 2 ++
1 file changed, 2 insertions(+)



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

* pgsql: Avoid delaying WAL receiver shutdown while draining WAL
@ 2026-11-19 04:31 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-11-19 04:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid delaying WAL receiver shutdown while draining WAL

Standby shutdown, promotion, and changes to replication connection
settings could be delayed while the WAL receiver was continuously
receiving WAL.

The inner receive loop in WalReceiverMain() processed all immediately
available messages without checking interrupts. If WAL arrived faster
than the receiver could write it, the receiver could remain in this
loop with SIGTERM pending, leaving the startup process waiting for it
to exit.

Fix this by checking interrupts on each iteration of the inner loop so
that pending shutdown requests are handled even when more WAL is
available.

Backpatch to all supported versions.

Reported-by: Andres Freund <andres@anarazel.de>
Author: Nitin Jadhav <nitinjadhavpostgres@gmail.com>
Reviewed-by: Joao Rito <joaovictor.rito@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/20210511022755.wcb5h4czadxsgewt@alap3.anarazel.de
Discussion: https://postgr.es/m/CAMm1aWY-bps8VPCdyTTZo6NZicSRrq0kBArzjKTZoKHdN_wqOA@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/898a967c0e45486420c85579fce444b0d4aced0d

Modified Files
--------------
src/backend/replication/walreceiver.c | 2 ++
1 file changed, 2 insertions(+)



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

* pgsql: Avoid delaying WAL receiver shutdown while draining WAL
@ 2026-11-19 04:31 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-11-19 04:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid delaying WAL receiver shutdown while draining WAL

Standby shutdown, promotion, and changes to replication connection
settings could be delayed while the WAL receiver was continuously
receiving WAL.

The inner receive loop in WalReceiverMain() processed all immediately
available messages without checking interrupts. If WAL arrived faster
than the receiver could write it, the receiver could remain in this
loop with SIGTERM pending, leaving the startup process waiting for it
to exit.

Fix this by checking interrupts on each iteration of the inner loop so
that pending shutdown requests are handled even when more WAL is
available.

Backpatch to all supported versions.

Reported-by: Andres Freund <andres@anarazel.de>
Author: Nitin Jadhav <nitinjadhavpostgres@gmail.com>
Reviewed-by: Joao Rito <joaovictor.rito@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/20210511022755.wcb5h4czadxsgewt@alap3.anarazel.de
Discussion: https://postgr.es/m/CAMm1aWY-bps8VPCdyTTZo6NZicSRrq0kBArzjKTZoKHdN_wqOA@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1901aa07eda15591423fe63e414c07dad2f23ec5

Modified Files
--------------
src/backend/replication/walreceiver.c | 2 ++
1 file changed, 2 insertions(+)



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

* pgsql: Avoid delaying WAL receiver shutdown while draining WAL
@ 2026-11-19 04:31 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-11-19 04:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid delaying WAL receiver shutdown while draining WAL

Standby shutdown, promotion, and changes to replication connection
settings could be delayed while the WAL receiver was continuously
receiving WAL.

The inner receive loop in WalReceiverMain() processed all immediately
available messages without checking interrupts. If WAL arrived faster
than the receiver could write it, the receiver could remain in this
loop with SIGTERM pending, leaving the startup process waiting for it
to exit.

Fix this by checking interrupts on each iteration of the inner loop so
that pending shutdown requests are handled even when more WAL is
available.

Backpatch to all supported versions.

Reported-by: Andres Freund <andres@anarazel.de>
Author: Nitin Jadhav <nitinjadhavpostgres@gmail.com>
Reviewed-by: Joao Rito <joaovictor.rito@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/20210511022755.wcb5h4czadxsgewt@alap3.anarazel.de
Discussion: https://postgr.es/m/CAMm1aWY-bps8VPCdyTTZo6NZicSRrq0kBArzjKTZoKHdN_wqOA@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_17_STABLE

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

Modified Files
--------------
src/backend/replication/walreceiver.c | 2 ++
1 file changed, 2 insertions(+)



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

* pgsql: Avoid delaying WAL receiver shutdown while draining WAL
@ 2026-11-19 04:31 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-11-19 04:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid delaying WAL receiver shutdown while draining WAL

Standby shutdown, promotion, and changes to replication connection
settings could be delayed while the WAL receiver was continuously
receiving WAL.

The inner receive loop in WalReceiverMain() processed all immediately
available messages without checking interrupts. If WAL arrived faster
than the receiver could write it, the receiver could remain in this
loop with SIGTERM pending, leaving the startup process waiting for it
to exit.

Fix this by checking interrupts on each iteration of the inner loop so
that pending shutdown requests are handled even when more WAL is
available.

Backpatch to all supported versions.

Reported-by: Andres Freund <andres@anarazel.de>
Author: Nitin Jadhav <nitinjadhavpostgres@gmail.com>
Reviewed-by: Joao Rito <joaovictor.rito@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/20210511022755.wcb5h4czadxsgewt@alap3.anarazel.de
Discussion: https://postgr.es/m/CAMm1aWY-bps8VPCdyTTZo6NZicSRrq0kBArzjKTZoKHdN_wqOA@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/63af66ebc57868cb5a40452fa84213b9763be447

Modified Files
--------------
src/backend/replication/walreceiver.c | 2 ++
1 file changed, 2 insertions(+)



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

* pgsql: Avoid delaying WAL receiver shutdown while draining WAL
@ 2026-11-19 04:31 Fujii Masao <fujii@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Fujii Masao @ 2026-11-19 04:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid delaying WAL receiver shutdown while draining WAL

Standby shutdown, promotion, and changes to replication connection
settings could be delayed while the WAL receiver was continuously
receiving WAL.

The inner receive loop in WalReceiverMain() processed all immediately
available messages without checking interrupts. If WAL arrived faster
than the receiver could write it, the receiver could remain in this
loop with SIGTERM pending, leaving the startup process waiting for it
to exit.

Fix this by checking interrupts on each iteration of the inner loop so
that pending shutdown requests are handled even when more WAL is
available.

Backpatch to all supported versions.

Reported-by: Andres Freund <andres@anarazel.de>
Author: Nitin Jadhav <nitinjadhavpostgres@gmail.com>
Reviewed-by: Joao Rito <joaovictor.rito@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/20210511022755.wcb5h4czadxsgewt@alap3.anarazel.de
Discussion: https://postgr.es/m/CAMm1aWY-bps8VPCdyTTZo6NZicSRrq0kBArzjKTZoKHdN_wqOA@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6901568906f9fb86b914cdfd5807b3cb507f9662

Modified Files
--------------
src/backend/replication/walreceiver.c | 2 ++
1 file changed, 2 insertions(+)



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


end of thread, other threads:[~2026-11-19 04:31 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-19 04:30 pgsql: Avoid delaying WAL receiver shutdown while draining WAL Fujii Masao <fujii@postgresql.org>
2026-11-19 04:31 pgsql: Avoid delaying WAL receiver shutdown while draining WAL Fujii Masao <fujii@postgresql.org>
2026-11-19 04:31 pgsql: Avoid delaying WAL receiver shutdown while draining WAL Fujii Masao <fujii@postgresql.org>
2026-11-19 04:31 pgsql: Avoid delaying WAL receiver shutdown while draining WAL Fujii Masao <fujii@postgresql.org>
2026-11-19 04:31 pgsql: Avoid delaying WAL receiver shutdown while draining WAL Fujii Masao <fujii@postgresql.org>
2026-11-19 04:31 pgsql: Avoid delaying WAL receiver shutdown while draining WAL Fujii Masao <fujii@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