mirror of
https://github.com/percona/pg_stat_monitor.git
synced 2026-02-04 14:06:20 +00:00
The pg_stat_monitor_errors view was created in order to help inspecting internal errors that may occur in pg_stat_monitor module itself, it contains the error message, its severity, the last time the error occurred and the number of times that any given error ocurred. Implementation details: - A new lwlock was added to the pgssSharedState structure in order to control access to the errors hash table. - Increased RequestNamedLWLockTranche() no. of locks requested to 2. - The function GetNamedLWLockTranche() returns an array of locks, we use the first lock for controlling access to the usual buckets hash table, and the second one to control access to the errors hash table. - During module initialization (_PG_init) we increased the amount of shared memory space requested to include space to the new errors hash table: RequestAddinShmemSpace(... + pgsm_errors_size()) - The implementation in pgsm_errors.c simple uses a hash table to track error messages, the message is also used as the key.
1.6 KiB
1.6 KiB