mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03: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:
@ -2900,6 +2900,9 @@ pgstat_initialize(void)
|
|||||||
MyBEEntry = &BackendStatusArray[MaxBackends + MyAuxProcType];
|
MyBEEntry = &BackendStatusArray[MaxBackends + MyAuxProcType];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Initialize SLRU statistics to zero */
|
||||||
|
memset(&SLRUStats, 0, sizeof(SLRUStats));
|
||||||
|
|
||||||
/* Set up a process-exit hook to clean up */
|
/* Set up a process-exit hook to clean up */
|
||||||
on_shmem_exit(pgstat_beshutdown_hook, 0);
|
on_shmem_exit(pgstat_beshutdown_hook, 0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user