mirror of
https://github.com/postgres/postgres.git
synced 2025-11-28 11:44:57 +03:00
Fix possible crash reading pg_stat_activity.
With the old code, a backend that read pg_stat_activity without ever having executed a parallel query might see a backend in the midst of executing one waiting on a DSA LWLock, resulting in a crash. The solution is for backends to register the tranche at startup time, not the first time a parallel query is executed. Report by Andreas Seltenreich. Patch by me, reviewed by Thomas Munro.
This commit is contained in:
@@ -508,6 +508,8 @@ RegisterLWLockTranches(void)
|
||||
LWLockRegisterTranche(LWTRANCHE_LOCK_MANAGER, "lock_manager");
|
||||
LWLockRegisterTranche(LWTRANCHE_PREDICATE_LOCK_MANAGER,
|
||||
"predicate_lock_manager");
|
||||
LWLockRegisterTranche(LWTRANCHE_PARALLEL_QUERY_DSA,
|
||||
"parallel_query_dsa");
|
||||
|
||||
/* Register named tranches. */
|
||||
for (i = 0; i < NamedLWLockTrancheRequests; i++)
|
||||
|
||||
Reference in New Issue
Block a user