Re: pg_subscription_rel entry can be updated concurrently

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_subscription_rel entry can be updated concurrently
Date: 2017-06-13 00:59:44
Message-ID: CAB7nPqS5kbNORk1My4D5oFZjie7HuaMbyj9p=bQQQsg_Bq0CWA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 13, 2017 at 9:52 AM, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
> Hi,
>
> I often get an error "ERROR: tuple concurrently updated" when
> changing subscription state(ALTER SUBSCRIPTION or DROP SUBSCRIPTION).
> The cause of this error is that table sync worker and apply worker can
> try to update the same tuple in pg_subscription_rel. Especially it
> often happens when we do initial copy for many tables and change it
> during executing.
>
> I think that touching the same tuple by two worker processes happens
> when aborting replication for a table or a subscription, so it would
> be the same result as when the worker ends up with an error. But I
> think since it's not an appropriate behavior we should deal with it.
> Any thoughts?

Yes, this error is normally not be something that users should see. So
there is something weird around the locking of the parent objects or
in the way the catalog is updated.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-06-13 01:03:31 Re: PostgreSQL 10 changes in exclusion constraints - did something change? CASE WHEN behavior oddity
Previous Message Masahiko Sawada 2017-06-13 00:52:20 pg_subscription_rel entry can be updated concurrently