From 84403b9717d4090513a12a3499b5a9b181efe68a Mon Sep 17 00:00:00 2001 From: Kyotaro Horiguchi Date: Thu, 11 Jan 2018 15:00:32 +0900 Subject: [PATCH v18 5/6] Documentation for slot-limit feature --- doc/src/sgml/catalogs.sgml | 37 +++++++++++++++++++++++++++++ doc/src/sgml/config.sgml | 23 ++++++++++++++++++ doc/src/sgml/high-availability.sgml | 8 ++++--- 3 files changed, 65 insertions(+), 3 deletions(-) diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 85ac79f07e..58dd7b6445 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -9974,6 +9974,43 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx + + wal_status + text + + + Availability of WAL files claimed by this + slot. normal, keeping, + losing or lost. + normal means that the claimed files are + available within max_wal_size. keeping means + max_wal_size is exceeded but still held by replication slots or + wal_keep_segments. + losing means that some of them are on the verge of + removal but the using session may go further. + lost means that some of them are definitely lost and + the session that used this slot cannot continue replication. This state + also implies the using session has been stopped. + + The last two states are seen only when + is + non-negative. If restart_lsn is NULL, this + field is null. + + + + + remain + bigint + + The amount in bytes WAL location (LSN) can advance that bytes + until this slot may lose required WAL + files. If restart_lsn is null + or wal_status is losing + or lost, this field is null. + + + diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 3ccacd528b..3e8884458c 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -3730,6 +3730,29 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows + + max_slot_wal_keep_size (integer) + + max_slot_wal_keep_size configuration parameter + + + + + Specify the maximum size of WAL files + that replication + slots are allowed to retain in the pg_wal + directory at checkpoint time. + If max_slot_wal_keep_size is -1 (the default), + replication slots retain unlimited amount of WAL files. If + restart_lsn of a replication slot gets behind more than that megabytes + from the current LSN, the standby using the slot may no longer be able + to continue replication due to removal of required WAL files. You + can see the WAL availability of replication slots + in pg_replication_slots. + + + + wal_sender_timeout (integer) diff --git a/doc/src/sgml/high-availability.sgml b/doc/src/sgml/high-availability.sgml index bc4d98fe03..328464c240 100644 --- a/doc/src/sgml/high-availability.sgml +++ b/doc/src/sgml/high-availability.sgml @@ -925,9 +925,11 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass' . However, these methods often result in retaining more WAL segments than required, whereas replication slots retain only the number of segments - known to be needed. An advantage of these methods is that they bound - the space requirement for pg_wal; there is currently no way - to do this using replication slots. + known to be needed. On the other hand, replication slots can retain so + many WAL segments that they fill up the space allocated + for pg_wal; + limits the size of WAL files + retained by replication slots. Similarly, -- 2.18.2