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.
Showing
- src/backend/access/transam/xlog.c 27 additions, 2 deletionssrc/backend/access/transam/xlog.c
- src/backend/postmaster/checkpointer.c 15 additions, 15 deletionssrc/backend/postmaster/checkpointer.c
- src/backend/storage/lmgr/lwlock.c 44 additions, 12 deletionssrc/backend/storage/lmgr/lwlock.c
- src/backend/storage/lmgr/proc.c 2 additions, 1 deletionsrc/backend/storage/lmgr/proc.c
- src/backend/storage/smgr/md.c 21 additions, 4 deletionssrc/backend/storage/smgr/md.c
- src/backend/utils/mmgr/mcxt.c 32 additions, 8 deletionssrc/backend/utils/mmgr/mcxt.c
- src/include/nodes/memnodes.h 3 additions, 0 deletionssrc/include/nodes/memnodes.h
- src/include/storage/lwlock.h 1 addition, 0 deletionssrc/include/storage/lwlock.h
- src/include/utils/memutils.h 2 additions, 0 deletionssrc/include/utils/memutils.h
Loading
Please register or sign in to comment