]> 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:56:24 +0000 (08:56 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 10 Jul 2018 23:56:24 +0000 (08:56 +0900)
commit56a714721343e6f52c0b1b911c0f160592348e84
tree58344b8c0a3aa8cd5a570d7b55cae34cbfb922c8
parentb6e3a3a492dbf2043e4b149221007716ba9e364e
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