aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/replication/logical/snapbuild.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c
index 366d19360cf..bf5f1db8565 100644
--- a/src/backend/replication/logical/snapbuild.c
+++ b/src/backend/replication/logical/snapbuild.c
@@ -371,6 +371,9 @@ AllocateSnapshotBuilder(ReorderBuffer *reorder,
MemoryContextSwitchTo(oldcontext);
+ /* The initial running transactions array must be empty. */
+ Assert(NInitialRunningXacts == 0 && InitialRunningXacts == NULL);
+
return builder;
}
@@ -391,6 +394,10 @@ FreeSnapshotBuilder(SnapBuild *builder)
/* other resources are deallocated via memory context reset */
MemoryContextDelete(context);
+
+ /* InitialRunningXacts is freed along with the context */
+ NInitialRunningXacts = 0;
+ InitialRunningXacts = NULL;
}
/*