]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix issue with WAL archiving in standby.
authorFujii Masao <fujii@postgresql.org>
Thu, 9 Sep 2021 14:58:54 +0000 (23:58 +0900)
committerFujii Masao <fujii@postgresql.org>
Thu, 9 Sep 2021 14:59:19 +0000 (23:59 +0900)
commitaacb3cfaf5e8b69da19446ad6a8e7ce426edb898
tree901dae2c2ab3466eaa169638eb6242c83f0b87a5
parent4559c161cb5db350690c2b942fa6fecb3a3e79d3
Fix issue with WAL archiving in standby.

Previously, walreceiver always closed the currently-opened WAL segment
and created its archive notification file, after it finished writing
the current segment up and received any WAL data that should be
written into the next segment. If walreceiver exited just before
any WAL data in the next segment arrived at standby, it did not
create the archive notification file of the current segment
even though that's known completed. This behavior could cause
WAL archiving of the segment to be delayed until subsequent
restartpoints or checkpoints created its notification file.

To fix the issue, this commit changes walreceiver so that it creates
an archive notification file of a current WAL segment immediately
if that's known completed before receiving next WAL data.

Back-patch to all supported branches.

Reported-by: Kyotaro Horiguchi
Author: Fujii Masao
Reviewed-by: Kyotaro Horiguchi
Discussion: https://postgr.es/m/20200630.165503.1465894182551545886.horikyota.ntt@gmail.com
src/backend/replication/walreceiver.c