Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset
Date: 2015-02-26 23:05:46
Message-ID: 31110.1424991946@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-02-26 23:09:10 Re: Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset
Previous Message Michael Paquier 2015-02-26 23:01:03 Re: [REVIEW] Re: Compression of full-page-writes