postgresql/contrib
Tom Lane ff769831e0 Improve autoprewarm's handling of early-shutdown scenarios.
Bad things happen if the DBA issues "pg_ctl stop -m fast" before
autoprewarm finishes loading its list of blocks to prewarm.
The current worker process successfully terminates early, but
(if this wasn't the last database with blocks to prewarm) the
leader process will just try to launch another worker for the
next database.  Since the postmaster is now in PM_WAIT_BACKENDS
state, it ignores the launch request, and the leader just sits
until it's killed manually.

This is mostly the fault of our half-baked design for launching
background workers, but a proper fix for that is likely to be
too invasive to be back-patchable.  To ameliorate the situation,
fix apw_load_buffers() to check whether SIGTERM has arrived
just before trying to launch another worker.  That leaves us with
only a very narrow window in each worker launch where SIGTERM
could occur between the launch request and successful worker start.

Another issue is that if the leader process does manage to exit,
it unconditionally rewrites autoprewarm.blocks with only the
blocks currently in shared buffers, thus forgetting any blocks
that we hadn't reached yet while prewarming.  This seems quite
unhelpful, since the next database start will then not have the
expected prewarming benefit.  Fix it to not modify the file if
we shut down before the initial load attempt is complete.

Per bug #16785 from John Thompson.  Back-patch to v11 where
the autoprewarm code was introduced.

Discussion: https://postgr.es/m/16785-c0207d8c67fb5f25@postgresql.org
2020-12-22 13:23:49 -05:00
..
adminpack
amcheck Fix some typos 2020-11-14 11:43:10 +09:00
auth_delay
auto_explain
bloom
bool_plperl
btree_gin
btree_gist Expose internal function for converting int64 to numeric 2020-09-09 20:16:28 +02:00
citext
cube
dblink Improve hash_create()'s API for some added robustness. 2020-12-15 11:38:53 -05:00
dict_int
dict_xsyn
earthdistance
file_fdw Remove leftover comments, left behind by removal of WITH OIDS. 2020-11-30 10:26:43 +02:00
fuzzystrmatch
hstore Allow subscripting of hstore values. 2020-12-11 18:58:21 -05:00
hstore_plperl
hstore_plpython
intagg
intarray
isn
jsonb_plperl Expose internal function for converting int64 to numeric 2020-09-09 20:16:28 +02:00
jsonb_plpython
lo
ltree
ltree_plpython
oid2name Remove arbitrary restrictions on password length. 2020-09-03 20:09:18 -04:00
old_snapshot Add new 'old_snapshot' contrib module. 2020-09-24 13:55:47 -04:00
pageinspect Remove unused parameter 2020-09-04 08:08:23 +02:00
passwordcheck
pg_buffercache
pg_freespacemap
pg_prewarm Improve autoprewarm's handling of early-shutdown scenarios. 2020-12-22 13:23:49 -05:00
pg_standby
pg_stat_statements pg_stat_statements: Track time at which all statistics were last reset. 2020-12-18 10:49:58 +09:00
pg_surgery pg_surgery: Try to stabilize regression tests. 2020-09-18 13:26:48 -04:00
pg_trgm Handle equality operator in contrib/pg_trgm 2020-11-15 08:52:35 +03:00
pg_visibility
pgcrypto Refactor logic to check for ASCII-only characters in string 2020-12-21 09:37:11 +09:00
pgrowlocks
pgstattuple
postgres_fdw Improve hash_create()'s API for some added robustness. 2020-12-15 11:38:53 -05:00
seg
sepgsql Fix expected output: the order of agg permission checks changed. 2020-11-24 12:50:16 +02:00
spi
sslinfo Use be_tls_* API for SSL information in sslinfo 2020-11-03 09:47:36 +01:00
start-scripts
tablefunc Improve hash_create()'s API for some added robustness. 2020-12-15 11:38:53 -05:00
tcn
test_decoding Fix 'skip-empty-xacts' option in test_decoding for streaming mode. 2020-11-17 12:14:53 +05:30
tsm_system_rows
tsm_system_time
unaccent
uuid-ossp Improve some code around cryptohash functions 2020-12-14 12:38:13 +09:00
vacuumlo Remove arbitrary restrictions on password length. 2020-09-03 20:09:18 -04:00
xml2
contrib-global.mk
Makefile Add new 'old_snapshot' contrib module. 2020-09-24 13:55:47 -04:00
README

The PostgreSQL contrib tree
---------------------------

This subtree contains porting tools, analysis utilities, and plug-in
features that are not part of the core PostgreSQL system, mainly
because they address a limited audience or are too experimental to be
part of the main source tree.  This does not preclude their
usefulness.

User documentation for each module appears in the main SGML
documentation.

When building from the source distribution, these modules are not
built automatically, unless you build the "world" target.  You can
also build and install them all by running "make all" and "make
install" in this directory; or to build and install just one selected
module, do the same in that module's subdirectory.

Some directories supply new user-defined functions, operators, or
types.  To make use of one of these modules, after you have installed
the code you need to register the new SQL objects in the database
system by executing a CREATE EXTENSION command.  In a fresh database,
you can simply do

    CREATE EXTENSION module_name;

See the PostgreSQL documentation for more information about this
procedure.