mirror of
https://github.com/percona/pg_stat_monitor.git
synced 2026-02-04 14:06:20 +00:00
Issue - (#51): Postgres process is taking too much CPU.
Jira: PG-141 There is lock conflict, so used LW_EXCLUSIVE instead of LW_SHARED. This need to be investigated again and check the possibility to use a shared lock.
This commit is contained in:
@@ -875,12 +875,15 @@ exit:
|
||||
Datum
|
||||
pg_stat_monitor_reset(PG_FUNCTION_ARGS)
|
||||
{
|
||||
pgssSharedState *pgss = pgsm_get_ss();
|
||||
/* Safety check... */
|
||||
if (!IsHashInitialize())
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
|
||||
errmsg("pg_stat_monitor: must be loaded via shared_preload_libraries")));
|
||||
LWLockAcquire(pgss->lock, LW_EXCLUSIVE);
|
||||
hash_entry_dealloc(-1);
|
||||
LWLockRelease(pgss->lock);
|
||||
PG_RETURN_VOID();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user