Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c4a17b0

Browse files
committed
Merge branch 'PGPROEE9_6_MULTIMASTER' of https://gitlab.postgrespro.ru/pgpro-dev/postgrespro into PGPROEE9_6_MULTIMASTER
2 parents 0625fd2 + c63e5b2 commit c4a17b0

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/backend/replication/logical/decode.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,8 @@ DecodeCommit(LogicalDecodingContext *ctx, XLogRecordBuffer *buf,
645645
*/
646646
strcpy(ctx->reorder->gid, parsed->twophase_gid);
647647
*ctx->reorder->state_3pc = '\0';
648+
SnapBuildCommitTxn(ctx->snapshot_builder, buf->origptr, xid,
649+
parsed->nsubxacts, parsed->subxacts, true);
648650
ReorderBufferCommitBareXact(ctx->reorder, xid, buf->origptr, buf->endptr,
649651
commit_time, origin_id, origin_lsn);
650652
} else {
@@ -699,9 +701,6 @@ DecodePrepare(LogicalDecodingContext *ctx, XLogRecordBuffer *buf,
699701
ReorderBufferXidSetCatalogChanges(rb, xid, buf->origptr);
700702
}
701703

702-
SnapBuildCommitTxn(ctx->snapshot_builder, buf->origptr, xid,
703-
parsed->nsubxacts, parsed->subxacts, false);
704-
705704
if (SnapBuildXactNeedsSkip(ctx->snapshot_builder, buf->origptr) ||
706705
(parsed->dbId != InvalidOid && parsed->dbId != ctx->slot->data.database) ||
707706
FilterByOrigin(ctx, origin_id))
@@ -777,6 +776,8 @@ DecodeAbort(LogicalDecodingContext *ctx, XLogRecordBuffer *buf,
777776
strcpy(ctx->reorder->gid, parsed->twophase_gid);
778777
*ctx->reorder->state_3pc = '\0';
779778

779+
SnapBuildAbortTxn(ctx->snapshot_builder, buf->record->EndRecPtr, xid,
780+
parsed->nsubxacts, parsed->subxacts);
780781
ReorderBufferCommitBareXact(ctx->reorder, xid, buf->origptr, buf->endptr,
781782
commit_time, origin_id, origin_lsn);
782783
}

src/backend/replication/logical/reorderbuffer.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,6 +1728,10 @@ ReorderBufferCommitBareXact(ReorderBuffer *rb, TransactionId xid,
17281728
txn = ReorderBufferTXNByXid(rb, xid, true, NULL, commit_lsn,
17291729
true);
17301730

1731+
if (rb->xact_action == XLOG_XACT_ABORT_PREPARED) {
1732+
ReorderBufferCleanupTXN(rb, txn);
1733+
}
1734+
17311735
txn->final_lsn = commit_lsn;
17321736
txn->end_lsn = end_lsn;
17331737
txn->commit_time = commit_time;

0 commit comments

Comments
 (0)