After the standby has been triggered, we cancel the
conflicting query and transactions immediately to
speed up a failover.
(errmsg("trigger file found: %s", TriggerFile)));
ShutdownWalRcv();
unlink(TriggerFile);
+ standby_triggered = true;
return true;
}
return false;
}
/*
+ * Is the standby triggered?
+ */
+bool
+StandbyIsTriggered(void)
+{
+ return standby_triggered;
+}
+
+/*
* Wake up startup process to replay newly arrived WAL, or to notice that
* failover has been requested.
*/
}
/* Is it time to kill it? */
- if (WaitExceedsMaxStandbyDelay())
+ if (StandbyIsTriggered() || WaitExceedsMaxStandbyDelay())
{
pid_t pid;
extern void HandleStartupProcInterrupts(void);
extern void StartupProcessMain(void);
+extern bool StandbyIsTriggered(void);
extern void WakeupRecovery(void);
#endif /* XLOG_H */