Re: [COMMITTERS] pgsql: Code cleanup in the wake of recent LWLock refactoring.

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Code cleanup in the wake of recent LWLock refactoring.
Date: 2016-02-13 11:40:09
Message-ID: CANP8+jJJ74ZAHm5k=jFhBxGANpcrrMM4up3at1x7x2EGtUZHww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 10 February 2016 at 16:36, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> > On Wed, Feb 10, 2016 at 11:08 AM, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
> wrote:
> >> (Sorry if this was discussed already, I haven't been paying attention)
> >>
> >> LWLockAssign() is used by extensions. Are we OK with just breaking them,
> >> requiring them to change LWLockAssign() with the new mechanism, with
> #ifdefs
> >> to support multiple server versions? Seems like it shouldn't be too
> hard to
> >> keep LWLockAssign() around for the benefit of extensions, so it seems a
> bit
> >> inconsiderate to remove it.
>
> > If there's a strong feeling that we should keep the old APIs around,
> > we can do that, but I think that (1) if we don't remove them now, we
> > probably never will and (2) they are vile APIs. Allocating the number
> > of add-in lwlocks that are requested or a minimum of 3 is just awful.
> > If somebody allocates a different number than they request it
> > sometimes works, except when combined with some other extension, when
> > it maybe doesn't work. This way, you ask for an LWLock under a given
> > name and then get it under that name, so if an extension does it
> > wrong, it is that extension that breaks rather than some other one. I
> > think that's enough benefit to justify requiring a small code change
> > on the part of extension authors that use LWLocks, but that's
> > obviously biased by my experience maintaining EDB's extensions, and
> > other people may well feel differently.
>
> FWIW, I wasn't paying attention either, but I'm convinced by Robert's
> argument. Avoiding coupling between extensions is worth an API break.
>

I don't buy that, sorry.

New features, new APIs, very much agreed. Better API is a reason for new
api, not a reason to remove old.

Old APIs - why can't we keep it? The change is minor, so it we can easily
map old to new. Why choose to break all extensions that do this? We could
easily keep this by making the old API assign locks out of a chunk called
"Old Extension API". Deprecate the old API and remove in a later release.
Like pretty much every other API we support.

We must respect that Extension authors need to support a number of our
releases, meaning their job is already complex enough. We want to support
people that write extensions, not throw obstacles in their path,

--
Simon Riggs http://www.2ndQuadrant.com/
<http://www.2ndquadrant.com/>
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Greg Stark 2016-02-13 13:41:29 Re: [COMMITTERS] pgsql: Add some isolation tests for deadlock detection and resolution.
Previous Message Pavel Stehule 2016-02-13 05:50:27 Re: [COMMITTERS] pgsql: Code cleanup in the wake of recent LWLock refactoring.

Browse pgsql-hackers by date

  From Date Subject
Next Message Kouhei Kaigai 2016-02-13 12:29:18 Re: Way to check whether a particular block is on the shared_buffer?
Previous Message Fabien COELHO 2016-02-13 07:41:39 Re: Seg fault in pgbench