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

From Tom Lane
Subject Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset
Date
Msg-id 31110.1424991946@sss.pgh.pa.us
Whole thread Raw
In response to Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
> On 2015-02-26 17:45:26 -0500, Tom Lane wrote:
>> With all due respect, that's utterly wrong.  I have looked at every single
>> MemoryContextReset call in the codebase, and as far as I can see the
>> *only* one that is in an error path is elog.c:336, which I'm quite certain
>> is wrong anyway (the other reset of ErrorContext in that file uses
>> MemoryContextResetAndDeleteChildren, this one should too).

> Sure, in the pg codebase. But there definitely are extensions using
> memory contexts. And there's code that has to work across several
> branches.  Backpatching alone imo presents a risk; there's nothing to
> warn you three years down the road that the MemoryContextReset() you
> just backpatched doesn't work the same in the backbranches.

> If the changes breaks some code it's likely actually a good thing:
> Because, as you say, using MemoryContextReset() will likely be the wrong
> thing, and they'll want to fix it for the existing branches as well.

Is that likely to happen?  I doubt it.  They'll just mutter under their
breath about useless API breakage and move on.

Basically, this is a judgment call, and I disagree with your judgment.
I think changing the behavior of MemoryContextReset is exactly what we
want to have happen.  (And I've got to say that I'm losing patience with
backwards-compatibility arguments taken to this degree.  We might as
well stop development entirely.)
        regards, tom lane



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [REVIEW] Re: Compression of full-page-writes
Next
From: Andres Freund
Date:
Subject: Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset