On Thu, Feb 4, 2021 at 9:55 AM Ajin Cherian <itsa...@gmail.com> wrote: > > On Wed, Feb 3, 2021 at 11:38 PM Amit Kapila <amit.kapil...@gmail.com> wrote: > > > Thanks for the report. The problem here was that the error occurred > > when we were trying to copy the large data. Now, before fetching the > > entire data we issued a rollback that led to this problem. I think the > > alternative here could be to first fetch the entire data when the > > error occurred then issue the following commands. Instead, I have > > modified the patch to perform 'drop_replication_slot' in the beginning > > if the relstate is datasync. Do let me know if you can think of a > > better way to fix this? > > I have verified that the problem is not seen after this patch. I also > agree with the approach taken for the fix, >
Thanks. I have fixed one of the issues reported by me earlier [1] wherein the tablesync worker can repeatedly fail if after dropping the slot there is an error while updating the SYNCDONE state in the database. I have moved the drop of the slot just before commit of the transaction where we are marking the state as SYNCDONE. Additionally, I have removed unnecessary includes in tablesync.c, updated the docs for Alter Subscription, and updated the comments at various places in the patch. I have also updated the commit message this time. I am still not very happy with the way we handle concurrent drop origins but probably that would be addressed by the other patch Peter is working on [2]. [1] - https://www.postgresql.org/message-id/CAA4eK1JdWv84nMyCpTboBURjj70y3BfO1xdy8SYPRqNxtH7TEA%40mail.gmail.com [2] - https://www.postgresql.org/message-id/CAHut%2BPsW6%2B7Ucb1sxjSNBaSYPGAVzQFbAEg4y1KsYQiGCnyGeQ%40mail.gmail.com -- With Regards, Amit Kapila.
v27-0001-Allow-multiple-xacts-during-table-sync-in-logica.patch
Description: Binary data