public inbox for [email protected]
help / color / mirror / Atom feedFrom: Amit Kapila <[email protected]>
To: Dilip Kumar <[email protected]>
Cc: Melih Mutlu <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication
Date: Wed, 6 Jul 2022 14:48:43 +0530
Message-ID: <CAA4eK1JWJtQdoHEnRO5XYpXSv6YwdZ5KjUa5yV1onxGAtsL+MQ@mail.gmail.com> (raw)
In-Reply-To: <CAFiTN-tff+RVLwkx0DkM77YZniohoq9gJ5AByU-0B=KUCmUyjQ@mail.gmail.com>
References: <CAGPVpCTq=rUDd4JUdaRc1XUWf4BrH2gdSNf3rtOMUGj9rPpfzQ@mail.gmail.com>
<CAA4eK1Knrj73YW181CBW15vCAqEgNi7Xk7dG8Oah4gg0A_GcOA@mail.gmail.com>
<CAFiTN-tff+RVLwkx0DkM77YZniohoq9gJ5AByU-0B=KUCmUyjQ@mail.gmail.com>
On Wed, Jul 6, 2022 at 1:47 PM Dilip Kumar <[email protected]> wrote:
>
> On Wed, Jul 6, 2022 at 9:06 AM Amit Kapila <[email protected]> wrote:
> >
> > How would you choose the slot name for the table sync, right now it
> > contains the relid of the table for which it needs to perform sync?
> > Say, if we ignore to include the appropriate identifier in the slot
> > name, we won't be able to resue/drop the slot after restart of table
> > sync worker due to an error.
>
> I had a quick look into the patch and it seems it is using the worker
> array index instead of relid while forming the slot name, and I think
> that make sense, because now whichever worker is using that worker
> index can reuse the slot created w.r.t that index.
>
I think that won't work because each time on restart the slot won't be
fixed. Now, it is possible that we may drop the wrong slot if that
state of copying rel is SUBREL_STATE_DATASYNC. Also, it is possible
that while creating a slot, we fail because the same name slot already
exists due to some other worker which has created that slot has been
restarted. Also, what about origin_name, won't that have similar
problems? Also, if the state is already SUBREL_STATE_FINISHEDCOPY, if
the slot is not the same as we have used in the previous run of a
particular worker, it may start WAL streaming from a different point
based on the slot's confirmed_flush_location.
--
With Regards,
Amit Kapila.
view thread (24+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication
In-Reply-To: <CAA4eK1JWJtQdoHEnRO5XYpXSv6YwdZ5KjUa5yV1onxGAtsL+MQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox