1
0
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:
Heikki Linnakangas
2014-06-30 10:13:48 +03:00
parent a749a23d7a
commit 1c6821be31
9 changed files with 147 additions and 42 deletions

View File

@@ -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();
}