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:49 +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 b974b3d438a03a03522f06cd8f56197bdcae9f21..9d160daa6cea80a1a8b4e71ac1a1fc00fb07658f 100644 (file)
@@ -6442,7 +6442,7 @@ HotStandbyActive(void)
 bool
 HotStandbyActiveInReplay(void)
 {
-   Assert(AmStartupProcess());
+   Assert(AmStartupProcess() || !IsPostmasterEnvironment);
    return LocalHotStandbyActive;
 }