Skip to content

Commit abd79ad

Browse files
knizhnikkelvich
authored andcommitted
Fix GUC for 2PC timeouts
1 parent 90c65ee commit abd79ad

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

Cluster.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ sub configure
100100
multimaster.conn_strings = '$connstr'
101101
multimaster.use_raftable = true
102102
multimaster.ignore_tables_without_pk = true
103+
multimaster.twopc_min_timeout = 60000
103104
raftable.id = $id
104105
raftable.peers = '$raftpeers'
105106
));

arbiter.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -720,11 +720,6 @@ static void MtmTransReceiver(Datum arg)
720720
MtmAbortTransaction(ts);
721721
}
722722

723-
if (!MtmUseDtm && msg->csn > ts->csn) {
724-
ts->csn = msg->csn;
725-
MtmSyncClock(ts->csn);
726-
}
727-
728723
if (++ts->nVotes == Mtm->nNodes) {
729724
/* All nodes are finished their transactions */
730725
if (ts->status == TRANSACTION_STATUS_ABORTED) {
@@ -735,7 +730,6 @@ static void MtmTransReceiver(Datum arg)
735730
MtmSendNotificationMessage(ts, MSG_PREPARE);
736731
} else {
737732
Assert(ts->status == TRANSACTION_STATUS_IN_PROGRESS);
738-
ts->csn = MtmAssignCSN();
739733
ts->status = TRANSACTION_STATUS_UNKNOWN;
740734
MtmWakeUpBackend(ts);
741735
}

multimaster.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ MtmPostPrepareTransaction(MtmCurrentTrans* x)
803803
}
804804
if (!ts->votingCompleted) {
805805
ts->status = TRANSACTION_STATUS_ABORTED;
806-
elog(WARNING, "Transaction is aborted because of %d msec timeout expiration", (int)timeout);
806+
elog(WARNING, "Transaction is aborted because of %d msec timeout expiration, prepare time %d msec", (int)timeout, (int)((ts->csn - x->snapshot)/1000));
807807
}
808808
x->status = ts->status;
809809
MTM_LOG3("%d: Result of vote: %d", MyProcPid, ts->status);
@@ -1604,7 +1604,7 @@ _PG_init(void)
16041604
return;
16051605

16061606
DefineCustomIntVariable(
1607-
"multimaster.2pc_min_timeout",
1607+
"multimaster.twopc_min_timeout",
16081608
"Minamal amount of time (milliseconds) to wait 2PC confirmation from all nodes",
16091609
"Timeout for 2PC is calculated as MAX(prepare_time*2pc_prepare_ratio/100,2pc_min_timeout)",
16101610
&Mtm2PCMinTimeout,
@@ -1619,7 +1619,7 @@ _PG_init(void)
16191619
);
16201620

16211621
DefineCustomIntVariable(
1622-
"multimaster.2pc_prepare_ratio",
1622+
"multimaster.twopc_prepare_ratio",
16231623
"Percent of prepare time for maximal time of second phase of two-pahse commit",
16241624
"Timeout for 2PC is calculated as MAX(prepare_time*2pc_prepare_ratio/100,2pc_min_timeout)",
16251625
&Mtm2PCPrepareRatio,

tests/perf.results

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,3 +328,6 @@ Bench finished at Пт. апр. 15 11:56:45 MSK 2016
328328
Bench started at Пт. апр. 15 18:41:39 MSK 2016
329329
astro5:{tps:17367.895646, transactions:1500000, selects:0, updates:3002062, aborts:1968, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:10000, hosts:3}
330330
Bench finished at Пт. апр. 15 18:43:05 MSK 2016
331+
Bench started at Пт. апр. 15 20:01:20 MSK 2016
332+
astro5:{tps:18310.750502, transactions:1500000, selects:0, updates:3001948, aborts:1897, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:10000, hosts:3}
333+
Bench finished at Пт. апр. 15 20:02:42 MSK 2016

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy