diff --git a/src/backend/replication/logical/decode.c b/src/backend/replication/logical/decode.c index e25dd6bc366..9fc3d778f79 100644 --- a/src/backend/replication/logical/decode.c +++ b/src/backend/replication/logical/decode.c @@ -201,10 +201,10 @@ xact_decode(LogicalDecodingContext *ctx, XLogRecordBuffer *buf) uint8 info = XLogRecGetInfo(r) & XLOG_XACT_OPMASK; /* - * If the snapshot isn't yet fully built, we cannot decode anything, so - * bail out. + * If the snapshot hasn't started building yet, the transaction won't be + * decoded or tracked by the snapshot, so bail out. */ - if (SnapBuildCurrentState(builder) < SNAPBUILD_FULL_SNAPSHOT) + if (SnapBuildCurrentState(builder) < SNAPBUILD_BUILDING_SNAPSHOT) return; switch (info) @@ -413,7 +413,7 @@ heap2_decode(LogicalDecodingContext *ctx, XLogRecordBuffer *buf) * determining the candidate catalog_xmin for the replication slot. See * SnapBuildProcessRunningXacts(). */ - if (SnapBuildCurrentState(builder) < SNAPBUILD_FULL_SNAPSHOT) + if (SnapBuildCurrentState(builder) < SNAPBUILD_BUILDING_SNAPSHOT) return; switch (info) diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c index a0293f6ec7c..758c869cde8 100644 --- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@ -3200,11 +3200,9 @@ ReorderBufferForget(ReorderBuffer *rb, TransactionId xid, XLogRecPtr lsn) * could have manipulated the catalog and we need to update the caches * according to that. */ - if (txn->base_snapshot != NULL && txn->ninvalidations > 0) + if (txn->ninvalidations > 0) ReorderBufferImmediateInvalidation(rb, txn->ninvalidations, txn->invalidations); - else - Assert(txn->ninvalidations == 0); /* remove potential on-disk data, and deallocate */ ReorderBufferCleanupTXN(rb, txn); @@ -3235,11 +3233,9 @@ ReorderBufferInvalidate(ReorderBuffer *rb, TransactionId xid, XLogRecPtr lsn) * interested in the transaction's contents, it could have manipulated the * catalog and we need to update the caches according to that. */ - if (txn->base_snapshot != NULL && txn->ninvalidations > 0) + if (txn->ninvalidations > 0) ReorderBufferImmediateInvalidation(rb, txn->ninvalidations, txn->invalidations); - else - Assert(txn->ninvalidations == 0); } @@ -4389,7 +4385,6 @@ ReorderBufferStreamTXN(ReorderBuffer *rb, ReorderBufferTXN *txn) */ if (txn->base_snapshot == NULL) { - Assert(txn->ninvalidations == 0); return; }