Re: Synchronizing slots from primary to standby

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: Ajin Cherian <itsajin(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Subject: Re: Synchronizing slots from primary to standby
Date: 2023-10-31 05:51:12
Message-ID: CAA4eK1JDo4p9KBYH5yCP27peCtfYQTvwxnD9M1=59YWxTzqEqQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 31, 2023 at 7:16 AM Hayato Kuroda (Fujitsu)
<kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
>
> > > 2.
> > > Currently ctx->failover is set only in the pgoutput_startup(), but not sure it is
> > OK.
> > > Can we change the parameter in CreateDecodingContext() or similar functions?
> > >
> > > Because IIUC it means that only slots which have pgoutput can wait. Other
> > > output plugins must understand the change and set faliover flag as well -
> > > I felt it is not good. E.g., you might miss to enable the parameter in
> > test_decoding.
> > >
> > > Regarding the two_phase parameter, setting on plugin layer is good because it
> > > quite affects the output. As for the failover, it is not related with the
> > > content so that all of slots should be enabled.
> > >
> > > I think CreateDecodingContext or StartupDecodingContext() is the common
> > path.
> > > Or, is it the out-of-scope for now?
> >
> > Currently, the failover field is part of the options list in the
> > StartReplicationCmd. This gives some
> > level of flexibility such that only plugins that are interested in
> > this need to handle it. The options list
> > is only deparsed by plugins. If we move it to outside of the options list,
> > this sort of changes the protocol for START_REPLICATION and will
> > impact all plugins.
> > But I agree to your larger point that, we need to do it in such a way that
> > other plugins do not unintentionally change the 'failover' behaviour
> > of the originally created slot.
> > Maybe I can code it in such a way that, only if the failover option is
> > specified in the list of options
> > passed as part of START_REPLICATION will it change the original slot
> > created 'failover' flag by adding
> > another flag "failover_opt_given". Plugins that set this, will be able
> > to change the failover flag of the slot,
> > while plugins that do not support this will not set this and the
> > failover flag of the created slot will remain.
> > What do you think?
>
> May be OK, but I came up with a corner case that external plugins have a streaming
> option 'failover'. What should be? Has the option been reserved?
>

Sorry, your question is not clear to me. Did you intend to say that
the value of the existing streaming option could be 'failover'?

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2023-10-31 06:11:45 Relids instead of Bitmapset * in plannode.h
Previous Message Ashutosh Bapat 2023-10-31 05:36:48 Re: Reuse child_relids in try_partitionwise_join was Re: Assert failure on bms_equal(child_joinrel->relids, child_joinrelids)