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 -- Sent via pgsql-hackers mailing list (email@example.com) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers