]> granicus.if.org Git - postgresql/commit
Fix and enhance the assertion of no palloc's in a critical section.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 30 Jun 2014 07:13:48 +0000 (10:13 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 30 Jun 2014 07:26:00 +0000 (10:26 +0300)
commit1c6821be31f91ab92547a8ed4246762c8cefb1b3
treede5e845c96e8f37b7073708a5bdf9e6b81c6abc9
parenta749a23d7af4dba9b3468076ec561d2cbf69af09
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.
src/backend/access/transam/xlog.c
src/backend/postmaster/checkpointer.c
src/backend/storage/lmgr/lwlock.c
src/backend/storage/lmgr/proc.c
src/backend/storage/smgr/md.c
src/backend/utils/mmgr/mcxt.c
src/include/nodes/memnodes.h
src/include/storage/lwlock.h
src/include/utils/memutils.h