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

Commit a2a686b

Browse files
committed
Use local oldestSnapshot in MtmAdjustOldestXid during recovery
1 parent 9503856 commit a2a686b

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

multimaster.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -744,11 +744,19 @@ MtmAdjustOldestXid(TransactionId xid)
744744
} else {
745745
oldestSnapshot = Mtm->nodes[MtmNodeId-1].oldestSnapshot;
746746
}
747-
for (i = 0; i < Mtm->nAllNodes; i++) {
748-
if (!BIT_CHECK(Mtm->disabledNodeMask, i)
749-
&& Mtm->nodes[i].oldestSnapshot < oldestSnapshot)
750-
{
751-
oldestSnapshot = Mtm->nodes[i].oldestSnapshot;
747+
/*
748+
* If there is no activity on neighbors during recovery then they will not
749+
* advance their oldestSnapshot, so we can explode our hashes. But during
750+
* recovery do not really need to look at oldestSnapshot of neighbors.
751+
*/
752+
if (Mtm->status != MTM_RECOVERY)
753+
{
754+
for (i = 0; i < Mtm->nAllNodes; i++) {
755+
if (!BIT_CHECK(Mtm->disabledNodeMask, i)
756+
&& Mtm->nodes[i].oldestSnapshot < oldestSnapshot)
757+
{
758+
oldestSnapshot = Mtm->nodes[i].oldestSnapshot;
759+
}
752760
}
753761
}
754762
if (oldestSnapshot > MtmVacuumDelay*USECS_PER_SEC) {

0 commit comments

Comments
 (0)