mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
Fix and enhance the assertion of no palloc's in a critical section.
The assertion failed if WAL_DEBUG or LWLOCK_STATS was enabled; fix that by using separate memory contexts for the allocations made within those code blocks. This patch introduces a mechanism for marking any memory context as allowed in a critical section. Previously ErrorContext was exempt as a special case. Instead of a blanket exception of the checkpointer process, only exempt the memory context used for the pending ops hash table.
This commit is contained in:
@@ -411,8 +411,9 @@ InitProcess(void)
|
||||
|
||||
/*
|
||||
* Now that we have a PGPROC, we could try to acquire locks, so initialize
|
||||
* the deadlock checker.
|
||||
* local state needed for LWLocks, and the deadlock checker.
|
||||
*/
|
||||
InitLWLockAccess();
|
||||
InitDeadLockChecking();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user