public inbox for [email protected]
help / color / mirror / Atom feedFrom: Nathan Bossart <[email protected]>
To: Amit Kapila <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Melih Mutlu <[email protected]>
Cc: Thomas Munro <[email protected]>
Cc: Hayato Kuroda (Fujitsu) <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: wake up logical workers after ALTER SUBSCRIPTION
Date: Tue, 3 Jan 2023 10:10:31 -0800
Message-ID: <20230103181031.GB204418@nathanxps13> (raw)
In-Reply-To: <CAA4eK1+WQCGswLqWDnMMMt6gCePx+1ZQ=C+qe7CrG1ALWNhtCA@mail.gmail.com>
References: <[email protected]>
<20221214004105.GA669835@nathanxps13>
<20221214171023.GA689106@nathanxps13>
<[email protected]>
<20221214174535.GA773264@nathanxps13>
<[email protected]>
<20221214183759.GC773264@nathanxps13>
<[email protected]>
<20221214231727.GA828014@nathanxps13>
<CAA4eK1+WQCGswLqWDnMMMt6gCePx+1ZQ=C+qe7CrG1ALWNhtCA@mail.gmail.com>
On Tue, Jan 03, 2023 at 11:03:32AM +0530, Amit Kapila wrote:
> On Thu, Dec 15, 2022 at 4:47 AM Nathan Bossart <[email protected]> wrote:
>> On Wed, Dec 14, 2022 at 02:02:58PM -0500, Tom Lane wrote:
>> > Maybe we could have workers that are exiting for that reason set a
>> > flag saying "please restart me without delay"?
>>
>> That helps a bit, but there are still delays when starting workers for new
>> subscriptions. I think we'd need to create a new array in shared memory
>> for subscription OIDs that need their workers started immediately.
>
> That would be tricky because the list of subscription OIDs can be
> longer than the workers. Can't we set a boolean variable
> (check_immediate or something like that) in LogicalRepCtxStruct and
> use that to traverse the subscriptions? So, when any worker will
> restart because of a parameter change, we can set the variable and
> send a signal to the launcher. The launcher can then check this
> variable to decide whether to start the missing workers for enabled
> subscriptions.
My approach was to add a variable to LogicalRepWorker that indicated
whether a worker needed to be restarted immediately. While this is a
little weird because the workers array is treated as slots, it worked
nicely for ALTER SUBSCRIPTION. However, this doesn't help at all for
CREATE SUBSCRIPTION.
IIUC you are suggesting just one variable that would bypass
wal_retrieve_retry_interval for all subscriptions, not just those newly
altered or created. This definitely seems like it would prevent delays,
but it would also cause wal_retrieve_retry_interval to be incorrectly
bypassed for the other workers in some cases. Is this acceptable?
--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com
view thread (2+ messages)
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], [email protected], [email protected], [email protected]
Subject: Re: wake up logical workers after ALTER SUBSCRIPTION
In-Reply-To: <20230103181031.GB204418@nathanxps13>
* 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