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

Commitefa73ef

Browse files
committed
Merge branch 'master' into more_tests
2 parentsf85ff8a +b4a5fe8 commitefa73ef

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

‎src/backend/access/transam/twophase.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,10 @@ EndPrepare(GlobalTransaction gxact)
10251025
xl_xact_originxl_origin;
10261026
xl_xact_xinfoxl_xinfo;
10271027
uint8info=XLOG_XACT_PREPARE;
1028+
boolreplorigin;
1029+
1030+
replorigin= (replorigin_session_origin!=InvalidRepOriginId&&
1031+
replorigin_session_origin!=DoNotReplicateId);
10281032

10291033
/* Add the end sentinel to the list of 2PC records */
10301034
RegisterTwoPhaseRecord(TWOPHASE_RM_END_ID,0,
@@ -1089,6 +1093,12 @@ EndPrepare(GlobalTransaction gxact)
10891093
XLogIncludeOrigin();
10901094

10911095
gxact->prepare_end_lsn=XLogInsert(RM_XACT_ID,info);
1096+
1097+
if (replorigin)
1098+
/* Move LSNs forward for this replication origin */
1099+
replorigin_session_advance(replorigin_session_origin_lsn,
1100+
XactLastRecEnd);
1101+
10921102
XLogFlush(gxact->prepare_end_lsn);
10931103

10941104
/* If we crash now, we have prepared: WAL replay will fix things */

‎src/backend/access/transam/xact.c‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5657,9 +5657,20 @@ xact_redo(XLogReaderState *record)
56575657
}
56585658
elseif (info==XLOG_XACT_PREPARE)
56595659
{
5660+
xl_xact_parsed_prepareparsed;
5661+
5662+
ParsePrepareRecord(XLogRecGetXid(record),XLogRecGetData(record),&parsed);
5663+
56605664
/* the record contents are exactly the 2PC file */
56615665
RecreateTwoPhaseFile(XLogRecGetXid(record),
56625666
XLogRecGetData(record),XLogRecGetDataLen(record));
5667+
5668+
if (parsed.xinfo&XACT_XINFO_HAS_ORIGIN)
5669+
{
5670+
/* recover apply progress */
5671+
replorigin_advance(XLogRecGetOrigin(record),parsed.origin_lsn,
5672+
record->EndRecPtr, false/* backward */ , false/* WAL */ );
5673+
}
56635674
}
56645675
elseif (info==XLOG_XACT_ASSIGNMENT)
56655676
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp