Skip to content

Commit aac8d16

Browse files
knizhnikkelvich
authored andcommitted
Fix 2pc timeout check
1 parent 0adf743 commit aac8d16

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

multimaster.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,13 +835,13 @@ MtmPostPrepareTransaction(MtmCurrentTrans* x)
835835
MtmUnlock();
836836
MtmResetTransaction(x);
837837
} else {
838-
time_t transTimeout = Max(Mtm2PCMinTimeout, (ts->csn - ts->snapshot)*Mtm2PCPrepareRatio/100000); /* usec->msec and percents */
838+
time_t transTimeout = Max(MSEC_TO_USEC(Mtm2PCMinTimeout), (ts->csn - ts->snapshot)*Mtm2PCPrepareRatio/100); /* usec->msec and percents */
839839
int result = 0;
840840
int nConfigChanges = Mtm->nConfigChanges;
841841

842842
timestamp_t start = MtmGetSystemTime();
843843
/* wait votes from all nodes */
844-
while (!ts->votingCompleted && start + transTimeout < MtmGetSystemTime())
844+
while (!ts->votingCompleted && start + transTimeout >= MtmGetSystemTime())
845845
{
846846
MtmUnlock();
847847
MtmWatchdog();

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