diff options
author | Michael Paquier <michael@paquier.xyz> | 2020-01-30 11:14:02 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2020-01-30 11:14:02 +0900 |
commit | b0afdcad21fde1470e6502a376bfaf0e10d384fa (patch) | |
tree | edbb04057dd2561df41768cf6837ffbe84cf0977 /doc/src | |
parent | 26a81bb8152bd9f29bc24c1edfc00e2cbcd68548 (diff) | |
download | postgresql-b0afdcad21fde1470e6502a376bfaf0e10d384fa.tar.gz postgresql-b0afdcad21fde1470e6502a376bfaf0e10d384fa.zip |
Fix slot data persistency when advancing physical replication slots
Advancing a physical replication slot with pg_replication_slot_advance()
did not mark the slot as dirty if any advancing was done, preventing the
follow-up checkpoint to flush the slot data to disk. This caused the
advancing to be lost even on clean restarts. This does not happen for
logical slots as any advancing marked the slot as dirty. Per
discussion, the original feature has been implemented so as in the event
of a crash the slot may move backwards to a past LSN. This property is
kept and more documentation is added about that.
This commit adds some new TAP tests to check the persistency of physical
and logical slots after advancing across clean restarts.
Author: Alexey Kondratov, Michael Paquier
Reviewed-by: Andres Freund, Kyotaro Horiguchi, Craig Ringer
Discussion: https://postgr.es/m/059cc53a-8b14-653a-a24d-5f867503b0ee@postgrespro.ru
Backpatch-through: 11
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/func.sgml | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 895b4b7b1b6..ceda48e0fc3 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -20470,8 +20470,11 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup()); <entry> Advances the current confirmed position of a replication slot named <parameter>slot_name</parameter>. The slot will not be moved backwards, - and it will not be moved beyond the current insert location. Returns - name of the slot and real position to which it was advanced to. + and it will not be moved beyond the current insert location. Returns + the name of the slot and the real position to which it was advanced to. + The information of the updated slot is written out at the follow-up + checkpoint if any advancing is done. In the event of a crash, the + slot may return to an earlier position. </entry> </row> |