postgresql/src/include
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
..
access Adjust max_slot_wal_keep_size behavior per review 2020-06-24 14:23:39 -04:00
bootstrap Update copyrights for 2020 2020-01-01 12:21:45 -05:00
catalog Bump catversion for ACL changes on replication origin functions 2020-06-15 15:26:51 +09:00
commands Unify drop-by-OID functions 2020-06-09 09:39:46 +02:00
common Move frontend-side archive APIs from src/common/ to src/fe_utils/ 2020-06-11 15:48:46 +09:00
datatype Update copyrights for 2020 2020-01-01 12:21:45 -05:00
executor Fix EXPLAIN ANALYZE for parallel HashAgg plans 2020-06-19 17:24:27 +12:00
fe_utils Move frontend-side archive APIs from src/common/ to src/fe_utils/ 2020-06-11 15:48:46 +09:00
foreign Update copyrights for 2020 2020-01-01 12:21:45 -05:00
jit jit: Reference expression step functions via llvmjit_types. 2020-02-06 22:29:14 -08:00
lib Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
libpq Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
mb Allow Unicode escapes in any server encoding, not only UTF-8. 2020-03-06 14:17:43 -05:00
nodes Fix EXPLAIN ANALYZE for parallel HashAgg plans 2020-06-19 17:24:27 +12:00
optimizer Rework HashAgg GUCs. 2020-06-11 12:57:43 -07:00
parser Revert 0f5ca02f53 2020-04-08 11:37:27 +03:00
partitioning Allow partitionwise joins in more cases. 2020-04-08 10:25:00 +09:00
port Avoid need for valgrind suppressions for pg_atomic_init_u64 on some platforms. 2020-06-08 19:52:19 -07:00
portability Update copyrights for 2020 2020-01-01 12:21:45 -05:00
postmaster Trigger autovacuum based on number of INSERTs 2020-03-28 19:20:12 +13:00
regex Assume that we have <wchar.h>. 2020-02-21 14:30:47 -05:00
replication Save slot's restart_lsn when invalidated due to size 2020-06-24 14:15:17 -04:00
rewrite Update copyrights for 2020 2020-01-01 12:21:45 -05:00
snowball Update snowball 2020-06-08 08:07:15 +02:00
statistics Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
storage Clean up includes of s_lock.h. 2020-06-18 19:41:05 -07:00
tcop Allow the planner-related functions and hook to accept the query string. 2020-03-30 13:51:05 +09:00
tsearch Assume that we have <wchar.h>. 2020-02-21 14:30:47 -05:00
utils Have pg_itoa, pg_ltoa and pg_lltoa return the length of the string 2020-06-13 12:32:00 +12:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
Makefile Get rid of jsonpath_gram.h and jsonpath_scanner.h 2019-03-20 11:13:34 +03:00
c.h Remove STATUS_WAITING 2020-06-17 09:14:37 +02:00
fmgr.h Fix minor violations of FunctionCallInvoke usage protocol. 2020-04-21 14:23:53 -04:00
funcapi.h Avoid holding a directory FD open across assorted SRF calls. 2020-03-16 21:05:52 -04:00
getaddrinfo.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
getopt_long.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
miscadmin.h Add unlikely() to CHECK_FOR_INTERRUPTS() 2020-06-05 16:49:25 -04:00
pg_config.h.in Enable Unix-domain sockets support on Windows 2020-03-28 15:01:01 +01:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Remove ACLDEBUG #define and associated code. 2020-04-23 15:38:04 -04:00
pg_getopt.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pg_trace.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pgstat.h Improve server code to read files as part of a base backup. 2020-06-17 11:39:17 -04:00
pgtar.h Assorted cleanup of tar-related code. 2020-06-15 15:28:49 -04:00
pgtime.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
port.h Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
postgres.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
postgres_ext.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postgres_fe.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
rusagestub.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
windowapi.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00