summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAmit Kapila <akapila@postgresql.org>2023-05-03 10:13:13 +0530
committerAmit Kapila <akapila@postgresql.org>2023-05-03 10:17:49 +0530
commitde63f8dadee4afa152ce177fd3c562d47373a728 (patch)
tree0d0dc49ae8ee5dded48eeb1e1594f2ceb2c708f4 /src/include
parent6489875ce6b16662142bc70e003437b9753c199f (diff)
downloadpostgresql-de63f8dadee4afa152ce177fd3c562d47373a728.tar.gz
Fix assertion failure in apply worker.
During exit, the logical replication apply worker tries to release session level locks, if any. However, if the apply worker exits due to an error before its connection is initialized, trying to release locks can lead to assertion failure. The locks will be acquired once the worker is initialized, so we don't need to release them till the worker initialization is complete. Reported-by: Alexander Lakhin Author: Hou Zhijie based on inputs from Sawada Masahiko and Amit Kapila Reviewed-by: Amit Kapila Discussion: https://postgr.es/m/2185d65f-5aae-3efa-c48f-fb42b173ef5c@gmail.com
Diffstat (limited to 'src/include')
-rw-r--r--src/include/replication/worker_internal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/replication/worker_internal.h b/src/include/replication/worker_internal.h
index dce71d2c50..b57eed052f 100644
--- a/src/include/replication/worker_internal.h
+++ b/src/include/replication/worker_internal.h
@@ -225,6 +225,8 @@ extern PGDLLIMPORT LogicalRepWorker *MyLogicalRepWorker;
extern PGDLLIMPORT bool in_remote_transaction;
+extern PGDLLIMPORT bool InitializingApplyWorker;
+
extern void logicalrep_worker_attach(int slot);
extern LogicalRepWorker *logicalrep_worker_find(Oid subid, Oid relid,
bool only_running);