postgresql/src
Amit Kapila cd142e032e Make pg_replication_origin_drop safe against concurrent drops.
Currently, we get the origin id from the name and then drop the origin by
taking ExclusiveLock on ReplicationOriginRelationId. So, two concurrent
sessions can get the id from the name at the same time and then when they
try to drop the origin, one of the sessions will get the either
"tuple concurrently deleted" or "cache lookup failed for replication
origin ..".

To prevent this race condition we do the entire operation under lock. This
obviates the need for replorigin_drop() API and we have removed it so if
any extension authors are using it they need to instead use
replorigin_drop_by_name. See it's usage in pg_replication_origin_drop().

Author: Peter Smith
Reviewed-by: Amit Kapila, Euler Taveira, Petr Jelinek, and Alvaro
Herrera
Discussion: https://www.postgresql.org/message-id/CAHut%2BPuW8DWV5fskkMWWMqzt-x7RPcNQOtJQBp6SdwyRghCk7A%40mail.gmail.com
2021-02-10 07:17:09 +05:30
..
backend Make pg_replication_origin_drop safe against concurrent drops. 2021-02-10 07:17:09 +05:30
bin Add option PROCESS_TOAST to VACUUM 2021-02-09 14:13:57 +09:00
common Introduce --with-ssl={openssl} as a configure option 2021-02-01 19:19:44 +09:00
fe_utils Generalize parallel slot result handling. 2021-02-05 16:08:45 -05:00
include Make pg_replication_origin_drop safe against concurrent drops. 2021-02-10 07:17:09 +05:30
interfaces
makefiles
pl Remove extra increment of plpgsql's statement counter for FOR loops. 2021-02-02 14:35:12 -05:00
port Move our p{read,write}v replacements into their own files. 2021-01-14 11:16:59 +13:00
template
test Revert "Display the time when the process started waiting for the lock, in pg_locks." 2021-02-09 18:30:40 +09:00
timezone
tools Move some code from src/bin/scripts to src/fe_utils to permit reuse. 2021-02-05 13:33:38 -05:00
tutorial
.gitignore
DEVELOPERS
Makefile
Makefile.global.in
Makefile.shlib
nls-global.mk