Re: [HACKERS] Re: Alter subscription..SET - NOTICE message is comingfor table which is already removed - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [HACKERS] Re: Alter subscription..SET - NOTICE message is comingfor table which is already removed
Date
Msg-id 9af32974-8787-8486-c2a9-842d073953a2@2ndquadrant.com
Whole thread Raw
In response to Re: [HACKERS] Re: Alter subscription..SET - NOTICE message is comingfor table which is already removed  (Masahiko Sawada <sawada.mshk@gmail.com>)
Responses Re: [HACKERS] Re: Alter subscription..SET - NOTICE message is comingfor table which is already removed  (Masahiko Sawada <sawada.mshk@gmail.com>)
List pgsql-hackers
On 5/30/17 13:25, Masahiko Sawada wrote:
> I think this cause is that the relation status entry could be deleted
> by ALTER SUBSCRIPTION REFRESH before corresponding table sync worker
> starting. Attached patch fixes issues reported on this thread so far.

I have committed the part of the patch that changes the
SetSubscriptionRelState() calls.

I think there was a mistake in your patch, in that the calls in
LogicalRepSyncTableStart() used true once and false once.  I think all
the calls in tablesync.c should be the same.

(If you look at the patch again, notice that I have changed the
insert_ok argument to update_only, so true and false are flipped.)

I'm not convinced about the change to the GetSubscriptionRelState()
argument.  In the examples given, no tables are removed from any
publications, so I don't see how the claimed situation can happen.  I
would like to see more reproducible examples.

Right now, if the subscription rel state disappears before the sync
worker starts, the error kills the sync worker, so things should
continue working correctly.  Perhaps the error message isn't the best.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] UPDATE of partition key
Next
From: Erik Rijkers
Date:
Subject: [HACKERS] logical replication - possible remaining problem