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:46 +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 a699ff8b567d949346535fb6e113b2a8e6d355a8..d1b381101b6e0418b63a2747b517c76b3514c336 100644 (file)
@@ -7575,7 +7575,7 @@ HotStandbyActive(void)
 bool
 HotStandbyActiveInReplay(void)
 {
-   Assert(AmStartupProcess());
+   Assert(AmStartupProcess() || !IsPostmasterEnvironment);
    return LocalHotStandbyActive;
 }