Restricting maximum keep segments by repslots
Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
From: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
To: pgsql-hackers@postgresql.org
Date: 2017-02-28T03:27:36Z
Lists: pgsql-hackers
Attachments
- 0001-Add-WAL-releaf-vent-for-replication-slots.patch (text/x-patch)
Hello. Although replication slot is helpful to avoid unwanted WAL deletion, on the other hand it can cause a disastrous situation by keeping WAL segments without a limit. Removing the causal repslot will save this situation but it is not doable if the standby is active. We should do a rather complex and forcible steps to relieve the situation especially in an automatic manner. (As for me, specifically in an HA cluster.) This patch adds a GUC to put a limit to the number of segments that replication slots can keep. Hitting the limit during checkpoint shows a warining and the segments older than the limit are removed. > WARNING: restart LSN of replication slots is ignored by checkpoint > DETAIL: Some replication slots lose required WAL segnents to continue. Another measure would be automatic deletion or inactivation of the culprit slot but it seems too complex for the problem. As we have already postponed some patches by the triage for the last commit fest, this might should be postponed to PG11. regards, -- Kyotaro Horiguchi NTT Open Source Software Center
Commits
-
Save slot's restart_lsn when invalidated due to size
- 12e52ba5a76e 13.0 landed
- 0188bb82531f 14.0 landed
-
Fix checkpoint signalling
- 1816a1c6ffe4 13.0 landed
-
Check slot->restart_lsn validity in a few more places
- d0abe78d8427 13.0 landed
-
Allow users to limit storage reserved by replication slots
- c6550776394e 13.0 landed
-
Remove header noise from test_decoding test
- 69360b34589b 13.0 landed
-
Rework WAL-reading supporting structs
- 709d003fbd98 13.0 cited
-
Flip argument order in XLogSegNoOffsetToRecPtr
- a22445ff0be2 12.0 cited