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

Commite25ebfb

Browse files
committed
Correctly handle two phase transation commit
1 parentcf9d417 commite25ebfb

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

‎contrib/pg_dtm/tests/dtmbench.cpp‎

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,21 @@ void* writer(void* arg)
190190
i -=1;
191191
continue;
192192
}
193-
pipelinesrcPipe(srcTx);
194-
pipelinedstPipe(dstTx);
195-
srcPipe.insert("commit transaction");
196-
dstPipe.insert("commit transaction");
197-
srcPipe.complete();
198-
dstPipe.complete();
199-
193+
try {
194+
pipelinesrcPipe(srcTx);
195+
pipelinedstPipe(dstTx);
196+
pipeline::query_id q1 = srcPipe.insert("commit transaction");
197+
pipeline::query_id q2 = dstPipe.insert("commit transaction");
198+
//srcPipe.complete();
199+
//dstPipe.complete();
200+
srcPipe.retrieve(q1);
201+
dstPipe.retrieve(q2);
202+
}catch (pqxx_exceptionconst& x) {
203+
t.aborts +=1;
204+
i -=1;
205+
continue;
206+
}
207+
200208
t.proceeded +=1;
201209
}
202210
returnNULL;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,7 @@ RecordTransactionCommit(void)
13131313
END_CRIT_SECTION();
13141314
if (!committed) {
13151315
CurrentTransactionState->state=TRANS_ABORT;
1316+
CurrentTransactionState->blockState=TBLOCK_ABORT_PENDING;
13161317
elog(ERROR,"Transaction commit rejected by XTM");
13171318
}
13181319
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp