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

From Heikki Linnakangas
Subject pgsql: Fix and enhance the assertion of no palloc's in a critical secti
Date
Msg-id E1X1WHJ-0000ev-Bs@gemulon.postgresql.org
Whole thread Raw
List 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(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Remove use_json_as_text options from json_to_record/json_populat
Next
From: Heikki Linnakangas
Date:
Subject: pgsql: Revert the assertion of no palloc's in critical section.