diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2020-06-24 14:23:39 -0400 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2020-06-24 14:23:39 -0400 |
commit | b8fd4e02c6d01183bf6def5897ad6cf7766bfff4 (patch) | |
tree | 11d04fed6fe779e476f821bf072036619ac9d809 /doc/src | |
parent | 0188bb82531f1b0ae3648fb81a4bd4a4f6242127 (diff) | |
download | postgresql-b8fd4e02c6d01183bf6def5897ad6cf7766bfff4.tar.gz postgresql-b8fd4e02c6d01183bf6def5897ad6cf7766bfff4.zip |
Adjust max_slot_wal_keep_size behavior per review
In pg_replication_slot, change output from normal/reserved/lost to
reserved/extended/unreserved/ lost, which better expresses the possible
states particularly near the time where segments are no longer safe but
checkpoint has not run yet.
Under the new definition, reserved means the slot is consuming WAL
that's still under the normal WAL size constraints; extended means it's
consuming WAL that's being protected by wal_keep_segments or the slot
itself, whose size is below max_slot_wal_keep_size; unreserved means the
WAL is no longer safe, but checkpoint has not yet removed those files.
Such as slot is in imminent danger, but can still continue for a little
while and may catch up to the reserved WAL space.
Also, there were some bugs in the calculations used to report the
status; fixed those.
Backpatch to 13.
Reported-by: Fujii Masao <masao.fujii@oss.nttdata.com>
Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@oss.nttdata.com>
Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://postgr.es/m/20200616.120236.1809496990963386593.horikyota.ntt@gmail.com
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/catalogs.sgml | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 5a66115df1e..49a881b2621 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -11239,19 +11239,29 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx Possible values are: <itemizedlist> <listitem> - <para><literal>normal</literal> means that the claimed files + <para><literal>reserved</literal> means that the claimed files are within <varname>max_wal_size</varname>.</para> </listitem> <listitem> - <para><literal>reserved</literal> means + <para><literal>extended</literal> means that <varname>max_wal_size</varname> is exceeded but the files are - still held, either by some replication slot or - by <varname>wal_keep_segments</varname>.</para> + still retained, either by the replication slot or + by <varname>wal_keep_segments</varname>. + </para> </listitem> <listitem> - <para><literal>lost</literal> means that some WAL files are - definitely lost and this slot cannot be used to resume replication - anymore.</para> + <para> + <literal>unreserved</literal> means that the slot no longer + retains the required WAL files and some of them are to be removed at + the next checkpoint. This state can return + to <literal>reserved</literal> or <literal>extended</literal>. + </para> + </listitem> + <listitem> + <para> + <literal>lost</literal> means that some required WAL files have + been removed and this slot is no longer usable. + </para> </listitem> </itemizedlist> The last two states are seen only when |