pgsql: Fix and enhance the assertion of no palloc's in a critical secti

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix and enhance the assertion of no palloc's in a critical secti
Date: 2014-06-30 07:45:29
Message-ID: E1X1WHJ-0000ev-Bs@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Thom Brown 2014-06-30 07:53:34 Re: pgsql: Add cluster_name GUC which is included in process titles if set.
Previous Message Tom Lane 2014-06-29 17:51:10 pgsql: Remove use_json_as_text options from json_to_record/json_populat