mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-23 19:39:53 +08:00
Initialize SLRU stats entries to zero.
Previously since SLRUStats was not initialized, SLRU stats counters could begin with non-zero value. Which could lead to incorrect results in pg_stat_slru view. Author: Fujii Masao Reviewed-by: Tomas Vondra Discussion: https://postgr.es/m/976bbb73-a112-de3c-c488-b34b64609793@oss.nttdata.com
This commit is contained in:
parent
ac3a4866c0
commit
f3d23d83ef
@ -2900,6 +2900,9 @@ pgstat_initialize(void)
|
||||
MyBEEntry = &BackendStatusArray[MaxBackends + MyAuxProcType];
|
||||
}
|
||||
|
||||
/* Initialize SLRU statistics to zero */
|
||||
memset(&SLRUStats, 0, sizeof(SLRUStats));
|
||||
|
||||
/* Set up a process-exit hook to clean up */
|
||||
on_shmem_exit(pgstat_beshutdown_hook, 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user