Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset
Date
Msg-id 20150226223116.GI24199@awork2.anarazel.de
Whole thread Raw
In response to Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset  (Andres Freund <andres@2ndquadrant.com>)
Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

On 2015-02-26 17:01:53 -0500, Tom Lane wrote:
> We've discussed doing $SUBJECT off and on for nearly ten years,
> the oldest thread I could find about it being here:
> http://www.postgresql.org/message-id/flat/1186435268.16321.37.camel@dell.linuxdev.us.dell.com
> It's come up again every time we found another leak of dead child
> contexts, which happened twice last year for example.  And that patch
> I'm pushing for "expanded" out-of-line objects really needs this to
> become the default behavior anywhere that we can detoast objects.

I don't object to the behavioural change per se, rather the contrary,
but I find it a pretty bad idea to change the meaning of an existing
functioname this way. Without a compiler erroring out people won't
notice that suddenly MemoryContextReset deletes much more; leading to
possibly hard to find errors. Context resets frequently are in error
paths, and those won't necessarily be hit when running with assertions
enabled.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: logical column ordering
Next
From: Tom Lane
Date:
Subject: Re: json_populate_record issue - TupleDesc reference leak