Skip to content

Commit c17006f

Browse files
knizhnikkelvich
authored andcommitted
Fix handling of mtm_restart_pos parameter
1 parent dd1634f commit c17006f

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

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(

multimaster.c

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

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

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

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy