Skip to content

Commit 6f12f71

Browse files
author
hackorum
committed
Apply v1-snapbuild-only.patch
1 parent 6e89028 commit 6f12f71

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/backend/replication/logical/snapbuild.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,21 @@ SnapBuildProcessRunningXacts(SnapBuild *builder, XLogRecPtr lsn, xl_running_xact
11431143
ReorderBufferTXN *txn;
11441144
TransactionId xmin;
11451145

1146+
/*
1147+
* A database-specific xl_running_xacts record only describes XIDs of
1148+
* transactions running in running->dbid; XIDs of transactions in other
1149+
* databases (including possibly our own) are missing from xids[] and not
1150+
* accounted for in oldestRunningXid/nextXid. Such a record may only be
1151+
* consumed by a decoder that itself opted out of cluster-wide tracking
1152+
* (db_specific == true). Otherwise we could mark the snapshot
1153+
* SNAPBUILD_CONSISTENT while transactions older than running->nextXid are
1154+
* still in progress in another database, causing their later commits to
1155+
* be silently dropped from the decoded change stream (data loss in
1156+
* downstream subscribers).
1157+
*/
1158+
if (!db_specific && OidIsValid(running->dbid))
1159+
return;
1160+
11461161
/*
11471162
* If we're not consistent yet, inspect the record to see whether it
11481163
* allows to get closer to being consistent. If we are consistent, dump

0 commit comments

Comments
 (0)