]> granicus.if.org Git - postgresql/commit
Block replication slot advance for these not yet reserving WAL
authorMichael Paquier <michael@paquier.xyz>
Tue, 10 Jul 2018 23:57:18 +0000 (08:57 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 10 Jul 2018 23:57:18 +0000 (08:57 +0900)
commit9069eb95f48c8200f8589faf7adc5e324eed25cd
tree2ba17f0b785bfc53fc6df17bedf96e52ad6d05df
parente7df94f317c979ad176adc0155a3e8af63e68ac9
Block replication slot advance for these not yet reserving WAL

Such replication slots are physical slots freshly created without WAL
being reserved, which is the default behavior, which have not been used
yet as WAL consumption resources to retain WAL.  This prevents advancing
a slot to a position older than any WAL available, which could falsify
calculations for WAL segment recycling.

This also cleans up a bit the code, as ReplicationSlotRelease() would be
called on ERROR, and improves error messages.

Reported-by: Kyotaro Horiguchi
Author: Michael Paquier
Reviewed-by: Andres Freund, Álvaro Herrera, Kyotaro Horiguchi
Discussion: https://postgr.es/m/20180626071305.GH31353@paquier.xyz
contrib/test_decoding/expected/slot.out
contrib/test_decoding/sql/slot.sql
doc/src/sgml/catalogs.sgml
src/backend/replication/slotfuncs.c