diff options
Diffstat (limited to 'src/backend/postmaster/postmaster.c')
-rw-r--r-- | src/backend/postmaster/postmaster.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index c966c2e83af..3fe45de5da0 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -1825,8 +1825,7 @@ canAcceptConnections(BackendType backend_type) else if (!FatalError && pmState == PM_STARTUP) return CAC_STARTUP; /* normal startup */ else if (!FatalError && pmState == PM_RECOVERY) - return CAC_NOTCONSISTENT; /* not yet at consistent recovery - * state */ + return CAC_NOTHOTSTANDBY; /* not yet ready for hot standby */ else return CAC_RECOVERY; /* else must be crash recovery */ } @@ -3699,6 +3698,7 @@ process_pm_pmsignal(void) /* WAL redo has started. We're out of reinitialization. */ FatalError = false; AbortStartTime = 0; + reachedConsistency = false; /* * Start the archiver if we're responsible for (re-)archiving received @@ -3724,9 +3724,15 @@ process_pm_pmsignal(void) UpdatePMState(PM_RECOVERY); } - if (CheckPostmasterSignal(PMSIGNAL_BEGIN_HOT_STANDBY) && + if (CheckPostmasterSignal(PMSIGNAL_RECOVERY_CONSISTENT) && pmState == PM_RECOVERY && Shutdown == NoShutdown) { + reachedConsistency = true; + } + + if (CheckPostmasterSignal(PMSIGNAL_BEGIN_HOT_STANDBY) && + (pmState == PM_RECOVERY && Shutdown == NoShutdown)) + { ereport(LOG, (errmsg("database system is ready to accept read-only connections"))); |