Skip to content

Commit fbc56f7

Browse files
committed
Shut down WAL receiver if it's still running at end of recovery. We used to
just check that it's not running and PANIC if it was, but that can rightfully happen if recovery stops at recovery target.
1 parent f71b5c7 commit fbc56f7

File tree

1 file changed

+4
-5
lines changed
  • src/backend/access/transam

1 file changed

+4
-5
lines changed

src/backend/access/transam/xlog.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6289,12 +6289,11 @@ StartupXLOG(void)
62896289
}
62906290

62916291
/*
6292-
* If we launched a WAL receiver, it should be gone by now. It will trump
6293-
* over the startup checkpoint and subsequent records if it's still alive,
6294-
* so be extra sure that it's gone.
6292+
* Kill WAL receiver, if it's still running, before we continue to write
6293+
* the startup checkpoint record. It will trump over the checkpoint and
6294+
* subsequent records if it's still alive when we start writing WAL.
62956295
*/
6296-
if (WalRcvInProgress())
6297-
elog(PANIC, "wal receiver still active");
6296+
ShutdownWalRcv();
62986297

62996298
/*
63006299
* We are now done reading the xlog from stream. Turn off streaming

0 commit comments

Comments
 (0)