aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 9ae01c13d51..6a4a5041fc5 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -6268,7 +6268,8 @@ RecoveryInProgress(void)
* true. Postmaster knows this by way of signal, not via shared memory.
*
* Unlike testing standbyState, this works in any process that's connected to
- * shared memory.
+ * shared memory. (And note that standbyState alone doesn't tell the truth
+ * anyway.)
*/
bool
HotStandbyActive(void)
@@ -6295,6 +6296,17 @@ HotStandbyActive(void)
}
/*
+ * Like HotStandbyActive(), but to be used only in WAL replay code,
+ * where we don't need to ask any other process what the state is.
+ */
+bool
+HotStandbyActiveInReplay(void)
+{
+ Assert(AmStartupProcess());
+ return LocalHotStandbyActive;
+}
+
+/*
* Is this process allowed to insert new WAL records?
*
* Ordinarily this is essentially equivalent to !RecoveryInProgress().