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

Commit bbf83b2

Browse files
committed
Fix handling of mtm_restart_pos parameter
1 parent fc058eb commit bbf83b2

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

contrib/mmts/Cluster.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ sub configure
108108
multimaster.max_nodes = 3
109109
multimaster.ignore_tables_without_pk = true
110110
multimaster.twopc_min_timeout = 2000
111+
log_line_prefix = '%t: '
111112
));
112113

113114
$node->append_conf("pg_hba.conf", qq(

contrib/mmts/multimaster.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2680,6 +2680,13 @@ void MtmReceiverStarted(int nodeId)
26802680
MtmUnlock();
26812681
}
26822682

2683+
void MtmReleaseRecoverySlot(int nodeId)
2684+
{
2685+
if (Mtm->recoverySlot == nodeId) {
2686+
Mtm->recoverySlot = 0;
2687+
}
2688+
}
2689+
26832690
/*
26842691
* Determine when and how we should open replication slot.
26852692
* Druing recovery we need to open only one replication slot from which node should receive all transactions.
@@ -2811,7 +2818,6 @@ MtmReplicationStartupHook(struct PGLogicalStartupHookArgs* args)
28112818
} else {
28122819
elog(ERROR, "Replication mode is not specified");
28132820
}
2814-
break;
28152821
} else if (strcmp("mtm_restart_pos", elem->defname) == 0) {
28162822
if (elem->arg != NULL && strVal(elem->arg) != NULL) {
28172823
recoveryStartPos = intVal(elem->arg);

contrib/mmts/multimaster.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ extern bool MtmWatchdog(timestamp_t now);
348348
extern void MtmCheckHeartbeat(void);
349349
extern void MtmResetTransaction(void);
350350
extern void MtmUpdateLockGraph(int nodeId, void const* messageBody, int messageSize);
351+
extern void MtmReleaseRecoverySlot(int nodeId);
351352
extern PGconn *PQconnectdb_safe(const char *conninfo);
352353

353354

contrib/mmts/pglogical_receiver.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,7 @@ pglogical_receiver_main(Datum main_arg)
649649

650650
OnError:
651651
PQfinish(conn);
652+
MtmReleaseRecoverySlot(nodeId);
652653
MtmSleep(RECEIVER_SUSPEND_TIMEOUT);
653654
}
654655
ByteBufferFree(&buf);

0 commit comments

Comments
 (0)