Skip to content

Commit 8c66044

Browse files
committed
Fix GUC for 2PC timeouts
1 parent d3df745 commit 8c66044

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

contrib/mmts/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
));

contrib/mmts/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
}

contrib/mmts/multimaster.c

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

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

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

contrib/mmts/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