Allow HotStandbyActiveInReplay() to be called in single user mode.
authorAndres Freund
Sun, 7 Jun 2015 22:30:26 +0000 (00:30 +0200)
committerAndres Freund
Mon, 8 Jun 2015 12:09:27 +0000 (14:09 +0200)
HotStandbyActiveInReplay, introduced in 061b079f, only allowed WAL
replay to happen in the startup process, missing the single user case.

This buglet is fairly harmless as it only causes problems when single
user mode in an assertion enabled build is used to replay a btree vacuum
record.

Backpatch to 9.2. 061b079f was backpatched further, but the assertion
was not.

src/backend/access/transam/xlog.c

index 666fa37e2a3f1d36a11d2311dc73930d016cf1ea..b732a9d76f7360d4a7b323f9874f37c74a256f9a 100644 (file)
@@ -7587,7 +7587,7 @@ HotStandbyActive(void)
 bool
 HotStandbyActiveInReplay(void)
 {
-   Assert(AmStartupProcess());
+   Assert(AmStartupProcess() || !IsPostmasterEnvironment);
    return LocalHotStandbyActive;
 }