Re: slru.c race condition (was Re: TRAP: FailedAssertion("!((itemid)->lp_flags - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: slru.c race condition (was Re: TRAP: FailedAssertion("!((itemid)->lp_flags
Date
Msg-id 20051103160124.GB7138@surnet.cl
Whole thread Raw
In response to Re: slru.c race condition (was Re: TRAP: FailedAssertion("!((itemid)->lp_flags  ("Jim C. Nasby" <jnasby@pervasive.com>)
Responses Re: slru.c race condition (was Re: TRAP: FailedAssertion("!((itemid)->lp_flags  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Jim C. Nasby wrote:

> BTW, is MEMORY_CONTEXT_CHECKING that expensive? It seems like it
> shouldn't be, but I'm only guessing at what exactly it does...

Yes, because not only it checks marker bytes at the end of palloc chunks
and similar stuff, but it also overwrites whole contexts with 0x7f when
they are reset.

May I propose to make Assert() yield only WARNINGs, and take out the
most expensive parts of MEMORY_CONTEXT_CHECKING, when --enable-cassert
is disabled?  Enabling it would trigger the current FailedAssertion and
all of MEMORY_CONTEXT_CHECKING.  That way we get all bug reports without
the expensive runtime costs for in-production systems.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Reducing the overhead of NUMERIC data
Next
From: Mark Wong
Date:
Subject: Re: Spinlocks, yet again: analysis and proposed patches