Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e927f55

Browse files
committedOct 27, 2016
If the stats collector dies during Hot Standby, restart it.
This bug exists as far back as 9.0, when Hot Standby was introduced, so back-patch to all supported branches. Report and patch by Takayuki Tsunakawa, reviewed by Michael Paquier and Kuntal Ghosh.
1 parent 92929a3 commit e927f55

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/backend/postmaster/postmaster.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,8 @@ ServerLoop(void)
17541754
PgArchPID = pgarch_start();
17551755

17561756
/* If we have lost the stats collector, try to start a new one */
1757-
if (PgStatPID == 0 && pmState == PM_RUN)
1757+
if (PgStatPID == 0 &&
1758+
(pmState == PM_RUN || pmState == PM_HOT_STANDBY))
17581759
PgStatPID = pgstat_start();
17591760

17601761
/* If we need to signal the autovacuum launcher, do so now */
@@ -2902,7 +2903,7 @@ reaper(SIGNAL_ARGS)
29022903
if (!EXIT_STATUS_0(exitstatus))
29032904
LogChildExit(LOG, _("statistics collector process"),
29042905
pid, exitstatus);
2905-
if (pmState == PM_RUN)
2906+
if (pmState == PM_RUN || pmState == PM_HOT_STANDBY)
29062907
PgStatPID = pgstat_start();
29072908
continue;
29082909
}

0 commit comments

Comments
 (0)
Failed to load comments.