Skip to content

Commit abc8752

Browse files
committed
Allow starting recovery from specified donor (extracted from fa0ca21)
1 parent ee20dac commit abc8752

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

contrib/mmts/multimaster.c

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

33483348
if (BIT_CHECK(Mtm->disabledNodeMask, MtmNodeId - 1))
33493349
{
3350-
/* Ok, then start recovery by luckiest walreceiver */
3351-
if (Mtm->recoverySlot == 0 || Mtm->recoverySlot == nodeId)
3350+
/* Ok, then start recovery by luckiest walreceiver (if there is no donor node).
3351+
* If this node was populated using basebackup, then donorNodeId is not zero and we should choose this node for recovery */
3352+
if ((Mtm->recoverySlot == 0 || Mtm->recoverySlot == nodeId)
3353+
&& (Mtm->donorNodeId == MtmNodeId || Mtm->donorNodeId == nodeId))
33523354
{
33533355
/* Lock on us */
33543356
Mtm->recoverySlot = nodeId;

0 commit comments

Comments
 (0)