Re: Get stuck when dropping a subscription during synchronizing table

From: tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>
To: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Subject: Re: Get stuck when dropping a subscription during synchronizing table
Date: 2017-05-25 08:29:51
Message-ID: 16f274af-3ef2-a171-1d84-20a797208251@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 05/25/2017 12:44 AM, Petr Jelinek wrote:
> There is still outstanding issue that sync worker will keep running
> inside the long COPY because the invalidation messages are also not
> processed until it finishes but all the original issues reported here
> disappear for me with the attached patches applied.
After applying all your patches, drop subscription no more hangs while
dropping subscription but there is an error "ERROR: tuple
concurrently updated" in the log file of
standby.

---
logical replication synchronization worker finished processing
2017-05-25 09:15:52.654 BST [18575] LOG: logical replication
synchronization worker finished processing
2017-05-25 09:15:52.656 BST [18563] LOG: starting logical replication
worker for subscription "sub"
2017-05-25 09:15:52.662 BST [18577] LOG: logical replication sync for
subscription sub, table t14 started
2017-05-25 09:15:53.657 BST [18563] LOG: starting logical replication
worker for subscription "sub"
2017-05-25 09:15:53.663 BST [18579] LOG: logical replication sync for
subscription sub, table t15 started
2017-05-25 09:15:53.724 BST [18563] FATAL: terminating logical
replication worker due to administrator command
2017-05-25 09:15:53.725 BST [18521] LOG: worker process: logical
replication worker for subscription 16684 (PID 18563) exited with exit
code 1
2017-05-25 09:15:54.734 BST [18579] ERROR: tuple concurrently updated
2017-05-25 09:15:54.735 BST [18577] ERROR: tuple concurrently updated
2017-05-25 09:15:54.736 BST [18521] LOG: worker process: logical
replication worker for subscription 16684 sync 16426 (PID 18579) exited
with exit code 1
2017-05-25 09:15:54.736 BST [18521] LOG: worker process: logical
replication worker for subscription 16684 sync 16423 (PID 18577) exited
with exit code 1
~
~
~

Steps to reproduce -
X cluster -> create 100 tables , publish all tables (create publication
pub for all tables);
Y Cluster -> create 100 tables ,create subscription(create subscription
sub connection 'user=centos host=localhost' publication pub;
Y cluster ->drop subscription - drop subscription sub;

check the log file on Y cluster.

Sometime , i have seen this error on psql prompt and drop subscription
operation got failed at first attempt.

postgres=# drop subscription sub;
ERROR: tuple concurrently updated
postgres=# drop subscription sub;
NOTICE: dropped replication slot "sub" on publisher
DROP SUBSCRIPTION

--
regards,tushar
EnterpriseDB https://www.enterprisedb.com/
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Neha Khatri 2017-05-25 08:57:03 Re: wal_level > WAL_LEVEL_LOGICAL
Previous Message Rajkumar Raghuwanshi 2017-05-25 07:09:13 Re: Adding support for Default partition in partitioning