Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit905ce98

Browse files
committed
Properly set committed subtransactions in snapbuilder.
1 parentbb2b803 commit905ce98

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

‎src/backend/replication/logical/decode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ DecodeCommit(LogicalDecodingContext *ctx, XLogRecordBuffer *buf,
579579
}
580580

581581
SnapBuildCommitTxn(ctx->snapshot_builder,buf->origptr,xid,
582-
parsed->nsubxacts,parsed->subxacts, true);
582+
parsed->nsubxacts,parsed->subxacts, true,parsed->nmsgs>0);
583583

584584
/* ----
585585
* Check whether we are interested in this specific transaction, and tell
@@ -646,7 +646,7 @@ DecodeCommit(LogicalDecodingContext *ctx, XLogRecordBuffer *buf,
646646
strcpy(ctx->reorder->gid,parsed->twophase_gid);
647647
*ctx->reorder->state_3pc='\0';
648648
SnapBuildCommitTxn(ctx->snapshot_builder,buf->origptr,xid,
649-
parsed->nsubxacts,parsed->subxacts, true);
649+
parsed->nsubxacts,parsed->subxacts, true, false);
650650
ReorderBufferCommitBareXact(ctx->reorder,xid,buf->origptr,buf->endptr,
651651
commit_time,origin_id,origin_lsn);
652652
}else {

‎src/backend/replication/logical/snapbuild.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ SnapBuildAbortTxn(SnapBuild *builder, XLogRecPtr lsn,
948948
*/
949949
void
950950
SnapBuildCommitTxn(SnapBuild*builder,XLogRecPtrlsn,TransactionIdxid,
951-
intnsubxacts,TransactionId*subxacts,boolisCommit)
951+
intnsubxacts,TransactionId*subxacts,boolisCommit,boolforceCatalog)
952952
{
953953
intnxact;
954954

@@ -1006,7 +1006,7 @@ SnapBuildCommitTxn(SnapBuild *builder, XLogRecPtr lsn, TransactionId xid,
10061006
* Add subtransaction to base snapshot if it DDL, we don't distinguish
10071007
* to toplevel transactions there.
10081008
*/
1009-
elseif (ReorderBufferXidHasCatalogChanges(builder->reorder,subxid))
1009+
elseif (ReorderBufferXidHasCatalogChanges(builder->reorder,subxid)||forceCatalog)
10101010
{
10111011
sub_needs_timetravel= true;
10121012

@@ -1034,7 +1034,7 @@ SnapBuildCommitTxn(SnapBuild *builder, XLogRecPtr lsn, TransactionId xid,
10341034
SnapBuildAddCommittedTxn(builder,xid);
10351035
}
10361036
/* add toplevel transaction to base snapshot */
1037-
elseif (ReorderBufferXidHasCatalogChanges(builder->reorder,xid))
1037+
elseif (ReorderBufferXidHasCatalogChanges(builder->reorder,xid)||forceCatalog)
10381038
{
10391039
elog(DEBUG2,"found top level transaction "XID_FMT", with catalog changes!",
10401040
xid);

‎src/include/replication/snapbuild.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ extern bool SnapBuildXactNeedsSkip(SnapBuild *snapstate, XLogRecPtr ptr);
7070

7171
externvoidSnapBuildCommitTxn(SnapBuild*builder,XLogRecPtrlsn,
7272
TransactionIdxid,intnsubxacts,
73-
TransactionId*subxacts,boolisCommit);
73+
TransactionId*subxacts,boolisCommit,boolforceCatalog);
7474
externvoidSnapBuildAbortTxn(SnapBuild*builder,XLogRecPtrlsn,
7575
TransactionIdxid,intnsubxacts,
7676
TransactionId*subxacts);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp