mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-03 01:16:56 +02:00
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.
This commit is contained in:
parent
ef18cb7da6
commit
0cbd199fd9
@ -1750,7 +1750,8 @@ ServerLoop(void)
|
||||
}
|
||||
|
||||
/* If we have lost the stats collector, try to start a new one */
|
||||
if (PgStatPID == 0 && pmState == PM_RUN)
|
||||
if (PgStatPID == 0 &&
|
||||
(pmState == PM_RUN || pmState == PM_HOT_STANDBY))
|
||||
PgStatPID = pgstat_start();
|
||||
|
||||
/* If we have lost the archiver, try to start a new one. */
|
||||
@ -2946,7 +2947,7 @@ reaper(SIGNAL_ARGS)
|
||||
if (!EXIT_STATUS_0(exitstatus))
|
||||
LogChildExit(LOG, _("statistics collector process"),
|
||||
pid, exitstatus);
|
||||
if (pmState == PM_RUN)
|
||||
if (pmState == PM_RUN || pmState == PM_HOT_STANDBY)
|
||||
PgStatPID = pgstat_start();
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user