summaryrefslogtreecommitdiff
path: root/src/include/nodes
diff options
context:
space:
mode:
authorHeikki Linnakangas2014-06-30 07:13:48 +0000
committerHeikki Linnakangas2014-06-30 07:26:00 +0000
commit1c6821be31f91ab92547a8ed4246762c8cefb1b3 (patch)
treede5e845c96e8f37b7073708a5bdf9e6b81c6abc9 /src/include/nodes
parenta749a23d7af4dba9b3468076ec561d2cbf69af09 (diff)
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.
Diffstat (limited to 'src/include/nodes')
-rw-r--r--src/include/nodes/memnodes.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/include/nodes/memnodes.h b/src/include/nodes/memnodes.h
index f79ebd423f..ad77509b0c 100644
--- a/src/include/nodes/memnodes.h
+++ b/src/include/nodes/memnodes.h
@@ -60,6 +60,9 @@ typedef struct MemoryContextData
MemoryContext nextchild; /* next child of same parent */
char *name; /* context name (just for debugging) */
bool isReset; /* T = no space alloced since last reset */
+#ifdef USE_ASSERT_CHECKING
+ bool allowInCritSection; /* allow palloc in critical section */
+#endif
} MemoryContextData;
/* utils/palloc.h contains typedef struct MemoryContextData *MemoryContext */