Thread: pgsql: Fix and enhance the assertion of no palloc's in a critical secti
pgsql: Fix and enhance the assertion of no palloc's in a critical secti
From
Heikki Linnakangas
Date:
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. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/1c6821be31f91ab92547a8ed4246762c8cefb1b3 Modified Files -------------- src/backend/access/transam/xlog.c | 29 +++++++++++++++-- src/backend/postmaster/checkpointer.c | 30 +++++++++--------- src/backend/storage/lmgr/lwlock.c | 56 ++++++++++++++++++++++++++------- src/backend/storage/lmgr/proc.c | 3 +- src/backend/storage/smgr/md.c | 25 ++++++++++++--- src/backend/utils/mmgr/mcxt.c | 40 ++++++++++++++++++----- src/include/nodes/memnodes.h | 3 ++ src/include/storage/lwlock.h | 1 + src/include/utils/memutils.h | 2 ++ 9 files changed, 147 insertions(+), 42 deletions(-)