Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bfc9f9a

Browse files
committed
Fix 2pc timeout check
1 parent 5760d42 commit bfc9f9a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/mmts/multimaster.c

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

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

0 commit comments

Comments
 (0)