diff options
Diffstat (limited to 'src/backend/replication/walreceiver.c')
-rw-r--r-- | src/backend/replication/walreceiver.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c index cb7bb47c9bd..9643c2ed7b3 100644 --- a/src/backend/replication/walreceiver.c +++ b/src/backend/replication/walreceiver.c @@ -503,7 +503,7 @@ WalReceiverMain(void) */ Assert(wait_fd != PGINVALID_SOCKET); rc = WaitLatchOrSocket(walrcv->latch, - WL_POSTMASTER_DEATH | WL_SOCKET_READABLE | + WL_EXIT_ON_PM_DEATH | WL_SOCKET_READABLE | WL_TIMEOUT | WL_LATCH_SET, wait_fd, NAPTIME_PER_CYCLE, @@ -524,15 +524,6 @@ WalReceiverMain(void) XLogWalRcvSendReply(true, false); } } - if (rc & WL_POSTMASTER_DEATH) - { - /* - * Emergency bailout if postmaster has died. This is to - * avoid the necessity for manual cleanup of all - * postmaster children. - */ - exit(1); - } if (rc & WL_TIMEOUT) { /* @@ -673,13 +664,6 @@ WalRcvWaitForStartPosition(XLogRecPtr *startpoint, TimeLineID *startpointTLI) { ResetLatch(walrcv->latch); - /* - * Emergency bailout if postmaster has died. This is to avoid the - * necessity for manual cleanup of all postmaster children. - */ - if (!PostmasterIsAlive()) - exit(1); - ProcessWalRcvInterrupts(); SpinLockAcquire(&walrcv->mutex); @@ -706,8 +690,8 @@ WalRcvWaitForStartPosition(XLogRecPtr *startpoint, TimeLineID *startpointTLI) } SpinLockRelease(&walrcv->mutex); - WaitLatch(walrcv->latch, WL_LATCH_SET | WL_POSTMASTER_DEATH, 0, - WAIT_EVENT_WAL_RECEIVER_WAIT_START); + (void) WaitLatch(walrcv->latch, WL_LATCH_SET | WL_EXIT_ON_PM_DEATH, 0, + WAIT_EVENT_WAL_RECEIVER_WAIT_START); } if (update_process_title) |