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

Commit c408a87

Browse files
committed
fix race between raising error in VotingCompleted and PollStatus: second should be called stricly after first as we need votingCompleted flag to be set
1 parent a2f8df4 commit c408a87

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

multimaster.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,7 @@ Mtm2PCVoting(MtmCurrentTrans* x, MtmTransState* ts)
12871287
{
12881288
MtmUnlock();
12891289
MTM_TXTRACE(x, "PostPrepareTransaction WaitLatch Start");
1290-
result = WaitLatch(&MyProc->procLatch, WL_LATCH_SET | WL_TIMEOUT | WL_POSTMASTER_DEATH, MtmHeartbeatRecvTimeout);
1290+
result = WaitLatch(&MyProc->procLatch, WL_LATCH_SET | WL_TIMEOUT | WL_POSTMASTER_DEATH, MtmHeartbeatSendTimeout);
12911291
MTM_TXTRACE(x, "PostPrepareTransaction WaitLatch Finish");
12921292
/* Emergency bailout if postmaster has died */
12931293
if (result & WL_POSTMASTER_DEATH) {
@@ -2058,6 +2058,8 @@ MtmPollStatusOfPreparedTransactions(bool majorMode)
20582058
MtmL2List *start = Mtm->activeTransList.next;
20592059
MtmL2List *cur;
20602060

2061+
MtmSleep(2*MtmHeartbeatSendTimeout);
2062+
20612063
for (cur = start; cur->next != start; cur = cur->next)
20622064
{
20632065
MtmTransState *ts = MtmGetActiveTransaction(cur);

0 commit comments

Comments
 (0)