]> granicus.if.org Git - postgresql/commitdiff
Allow HotStandbyActiveInReplay() to be called in single user mode.
authorAndres Freund <andres@anarazel.de>
Sun, 7 Jun 2015 22:30:26 +0000 (00:30 +0200)
committerAndres Freund <andres@anarazel.de>
Mon, 8 Jun 2015 12:09:52 +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 9ff3069504e05b1b791fc81351a53ea7be527008..ea1af8ccbba2ec8b5400d3c91b8140d7ef92c4c1 100644 (file)
@@ -7627,7 +7627,7 @@ HotStandbyActive(void)
 bool
 HotStandbyActiveInReplay(void)
 {
-       Assert(AmStartupProcess());
+       Assert(AmStartupProcess() || !IsPostmasterEnvironment);
        return LocalHotStandbyActive;
 }