Skip to content

Commit da2cd2f

Browse files
committed
Avoid hanging on exit in pglogical_receiver
1 parent d1c28a2 commit da2cd2f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

contrib/mmts/multimaster.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2325,7 +2325,7 @@ void MtmReceiverStarted(int nodeId)
23252325
MtmReplicationMode MtmGetReplicationMode(int nodeId)
23262326
{
23272327
bool recovery = false;
2328-
while (Mtm->status != MTM_CONNECTED && Mtm->status != MTM_ONLINE) {
2328+
if (Mtm->status != MTM_CONNECTED && Mtm->status != MTM_ONLINE) {
23292329
MTM_LOG2("%d: receiver slot mode %s", MyProcPid, MtmNodeStatusMnem[Mtm->status]);
23302330
if (Mtm->status == MTM_RECOVERY) {
23312331
recovery = true;
@@ -2342,6 +2342,7 @@ MtmReplicationMode MtmGetReplicationMode(int nodeId)
23422342
}
23432343
/* delay opening of other slots until recovery is completed */
23442344
MtmSleep(STATUS_POLL_DELAY);
2345+
return REPLMODE_UNKNOWN;
23452346
}
23462347
if (recovery) {
23472348
MTM_LOG1("Recreate replication slot for node %d after end of recovery", nodeId);

contrib/mmts/multimaster.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ typedef enum
117117

118118
typedef enum
119119
{
120+
REPLMODE_UNKNOWN, /* receiver should wait */
120121
REPLMODE_RECOVERED, /* recovery of node is completed so drop old slot and restart replication from the current position in WAL */
121122
REPLMODE_RECOVERY, /* perform recorvery of the node by applying all data from the slot from specified point */
122123
REPLMODE_NORMAL /* normal mode: use existed slot or create new one and start receiving data from it from the specified position */

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