postgresql/src/backend/access
Alvaro Herrera b8fd4e02c6
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
2020-06-24 14:23:39 -04:00
..
brin Implement operator class parameters 2020-03-30 19:17:23 +03:00
common Fix some comments referring to past features 2020-06-15 21:18:14 +09:00
gin Modify additional power 2 calculations to use new helper functions 2020-04-08 18:29:51 +12:00
gist Fix buffile.c error handling. 2020-06-16 16:59:07 +12:00
hash Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
heap Improve comments for [Heap]CheckForSerializableConflictOut(). 2020-06-12 10:55:38 +12:00
index Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
nbtree Fix deduplication "single value" strategy bug. 2020-06-19 08:57:24 -07:00
rmgrdesc Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
spgist Fix masking of SP-GiST pages during xlog consistency check 2020-06-20 17:34:51 +03:00
table Introduce macros for typalign and typstorage constants. 2020-03-04 10:34:25 -05:00
tablesample Move src/backend/utils/hash/hashfn.c to src/common 2020-02-27 09:25:41 +05:30
transam Adjust max_slot_wal_keep_size behavior per review 2020-06-24 14:23:39 -04:00
Makefile Introduce access/{table.h, relation.h}, for generic functions from heapam.h. 2019-01-21 10:51:36 -08:00