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

Commit 426b00d

Browse files
committed
Allow starting recovery from specified donor (extracted from fa0ca21)
1 parent 34c4dd5 commit 426b00d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

multimaster.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3343,8 +3343,10 @@ MtmReplicationMode MtmGetReplicationMode(int nodeId, sig_atomic_t volatile* shut
33433343

33443344
if (BIT_CHECK(Mtm->disabledNodeMask, MtmNodeId - 1))
33453345
{
3346-
/* Ok, then start recovery by luckiest walreceiver */
3347-
if (Mtm->recoverySlot == 0 || Mtm->recoverySlot == nodeId)
3346+
/* Ok, then start recovery by luckiest walreceiver (if there is no donor node).
3347+
* If this node was populated using basebackup, then donorNodeId is not zero and we should choose this node for recovery */
3348+
if ((Mtm->recoverySlot == 0 || Mtm->recoverySlot == nodeId)
3349+
&& (Mtm->donorNodeId == MtmNodeId || Mtm->donorNodeId == nodeId))
33483350
{
33493351
/* Lock on us */
33503352
Mtm->recoverySlot = nodeId;

0 commit comments

Comments
 (0)