Re: Alter index rename concurrently to

From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, aaklychkov(at)mail(dot)ru, "[pgdg] Robert Haas" <robertmhaas(at)gmail(dot)com>, vyegorov(at)gmail(dot)com, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Alter index rename concurrently to
Date: 2018-10-25 17:35:42
Message-ID: CAFcNs+rK9HTy=okA5k-U+gXW5N-MdibLgERUVi8VY_ambYOBng@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 25, 2018 at 4:41 AM Peter Eisentraut <
peter(dot)eisentraut(at)2ndquadrant(dot)com> wrote:
>
> On 17/10/2018 23:11, Peter Eisentraut wrote:
> > On 13/10/2018 04:01, Andres Freund wrote:
> >> I don't see how this could be argued. It has to be a self-conflicting
> >> lockmode, otherwise you'd end up doing renames of tables where you
> >> cannot see the previous state. And you'd get weird errors about
updating
> >> invisible rows etc.
> >
> >> I don't buy this description. Imo it's a fundamental correctness
> >> thing. Without it concurrent DDL would potentially overwrite the
rename,
> >> because they could start updating while still seeing the old version.
> >
> > OK, I can refine those descriptions/comments. Do you have any concerns
> > about the underlying principle of this patch?
>
> Patch with updated comments to reflect your input.
>

Great... this patch will help a lot so I took the liberty to perform some
review:

- the doc and code (simple) looks good
- the patch apply cleanly against current master
- all tests (check and check-world) past without any issue

I also perform some test using DDLs and DMLs in various sessions:

- renaming indexes / dml against same table
- creating and renaming indexes / altering tables in other session
- renaming indexes / dropping indexes

I didn't found any issue, so the patch looks in a very good shape.

Regards,

--
Fabrízio de Royes Mello Timbira - http://www.timbira.com.br/
PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruno Wolff III 2018-10-25 17:43:06 Re: Should pg 11 use a lot more memory building an spgist index?
Previous Message Fabien COELHO 2018-10-25 17:06:30 Re: libpq host/hostaddr/conninfo inconsistencies