Allow users to limit storage reserved by replication slots
authorAlvaro Herrera <[email protected]>
Tue, 7 Apr 2020 22:35:00 +0000 (18:35 -0400)
committerAlvaro Herrera <[email protected]>
Tue, 7 Apr 2020 22:35:00 +0000 (18:35 -0400)
commitc6550776394e25c1620bc8258427c8f1d448080d
treeeb5a62fdc5dcca2911d82af615bac3d36f8cf611
parentb63c293bcbd7439f883cd4cf748f6755df0fbb3c
Allow users to limit storage reserved by replication slots

Replication slots are useful to retain data that may be needed by a
replication system.  But experience has shown that allowing them to
retain excessive data can lead to the primary failing because of running
out of space.  This new feature allows the user to configure a maximum
amount of space to be reserved using the new option
max_slot_wal_keep_size.  Slots that overrun that space are invalidated
at checkpoint time, enabling the storage to be released.

Author: Kyotaro HORIGUCHI <[email protected]>
Reviewed-by: Masahiko Sawada <[email protected]>
Reviewed-by: Jehan-Guillaume de Rorthais <[email protected]>
Reviewed-by: Álvaro Herrera <[email protected]>
Discussion: https://postgr.es/m/20170228.122736.123383594[email protected]
17 files changed:
doc/src/sgml/catalogs.sgml
doc/src/sgml/config.sgml
doc/src/sgml/high-availability.sgml
src/backend/access/transam/xlog.c
src/backend/catalog/system_views.sql
src/backend/replication/logical/logicalfuncs.c
src/backend/replication/slot.c
src/backend/replication/slotfuncs.c
src/backend/replication/walsender.c
src/backend/utils/misc/guc.c
src/backend/utils/misc/postgresql.conf.sample
src/include/access/xlog.h
src/include/catalog/catversion.h
src/include/catalog/pg_proc.dat
src/include/replication/slot.h
src/test/recovery/t/019_replslot_limit.pl [new file with mode: 0644]
src/test/regress/expected/rules.out