postgresql/src/backend
Alvaro Herrera 96540f80f8
Fix race condition in invalidating obsolete replication slots
The code added to mark replication slots invalid in commit c655077639
had the race condition that a slot can be dropped or advanced
concurrently with checkpointer trying to invalidate it.  Rewrite the
code to close those races.

The changes to ReplicationSlotAcquire's API added with c655077639 are
not necessary anymore.  To avoid an ABI break in released branches, this
commit leaves that unchanged; it'll be changed in a master-only commit
separately.

Backpatch to 13, where this code first appeared.

Reported-by: Andres Freund <andres@anarazel.de>
Author: Andres Freund <andres@anarazel.de>
Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://postgr.es/m/20210408001037.wfmk6jud36auhfqm@alap3.anarazel.de
2021-06-11 12:16:14 -04:00
..
access Fix an asssortment of typos in brin_minmax_multi.c and mcv.c 2021-06-10 20:13:44 +12:00
bootstrap Rethink definition of pg_attribute.attcompression. 2021-05-27 13:24:27 -04:00
catalog Reconsider the handling of procedure OUT parameters. 2021-06-10 17:11:36 -04:00
commands Reconsider the handling of procedure OUT parameters. 2021-06-10 17:11:36 -04:00
executor Use the correct article for abbreviations 2021-06-11 13:38:04 +12:00
foreign Update copyright for 2021 2021-01-02 13:06:25 -05:00
jit Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
lib Fix typo in comment 2021-04-20 14:35:16 +02:00
libpq Fix RADIUS error reporting in hba file parsing 2021-05-31 18:43:48 +02:00
main Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodes Reconsider the handling of procedure OUT parameters. 2021-06-10 17:11:36 -04:00
optimizer Reconsider the handling of procedure OUT parameters. 2021-06-10 17:11:36 -04:00
parser Change position of field "transformed" in struct CreateStatsStmt. 2021-06-10 21:56:14 -07:00
partitioning Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
po Translation updates 2021-05-17 14:30:27 +02:00
port Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
postmaster Be more verbose when the postmaster unexpectedly quits. 2021-05-23 10:50:21 -04:00
regex Fix performance issue in new regex match-all detection code. 2021-05-03 11:42:31 -04:00
replication Fix race condition in invalidating obsolete replication slots 2021-06-11 12:16:14 -04:00
rewrite Adjust locations which have an incorrect copyright year 2021-06-04 12:19:50 +12:00
snowball Update snowball 2021-02-19 08:10:15 +01:00
statistics Fix an asssortment of typos in brin_minmax_multi.c and mcv.c 2021-06-10 20:13:44 +12:00
storage Fix typo and outdated information in README.barrier 2021-05-18 09:54:56 +12:00
tcop Restore the portal-level snapshot after procedure COMMIT/ROLLBACK. 2021-05-21 14:03:59 -04:00
tsearch Fix typos and grammar in comments and docs 2021-04-19 11:32:30 +09:00
utils Reconsider the handling of procedure OUT parameters. 2021-06-10 17:11:36 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Use sort_template.h for qsort_tuple() and qsort_ssup(). 2021-03-03 17:02:32 +13:00
nls.mk Translation updates 2021-05-10 14:36:21 +02:00