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

Commit 1df51e3

Browse files
knizhnikkelvich
authored andcommitted
Avoid hanging on exit in pglogical_receiver
1 parent 698932b commit 1df51e3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

multimaster.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -2334,7 +2334,7 @@ void MtmReceiverStarted(int nodeId)
23342334
MtmReplicationMode MtmGetReplicationMode(int nodeId)
23352335
{
23362336
bool recovery = false;
2337-
while (Mtm->status != MTM_CONNECTED && Mtm->status != MTM_ONLINE) {
2337+
if (Mtm->status != MTM_CONNECTED && Mtm->status != MTM_ONLINE) {
23382338
MTM_LOG2("%d: receiver slot mode %s", MyProcPid, MtmNodeStatusMnem[Mtm->status]);
23392339
if (Mtm->status == MTM_RECOVERY) {
23402340
recovery = true;
@@ -2351,6 +2351,7 @@ MtmReplicationMode MtmGetReplicationMode(int nodeId)
23512351
}
23522352
/* delay opening of other slots until recovery is completed */
23532353
MtmSleep(STATUS_POLL_DELAY);
2354+
return REPLMODE_UNKNOWN;
23542355
}
23552356
if (recovery) {
23562357
MTM_LOG1("Recreate replication slot for node %d after end of recovery", nodeId);

multimaster.h

+1
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)