Re: [HACKERS] logical decoding of two-phase transactions

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: Ajin Cherian <itsajin(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] logical decoding of two-phase transactions
Date: 2021-03-17 03:16:58
Message-ID: CAA4eK1+e_KZy9XKZKFQ+WOr9xxhvHh4veY64Mi3jKNLo94Wn6w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 17, 2021 at 8:07 AM vignesh C <vignesh21(at)gmail(dot)com> wrote:
>
> On Tue, Mar 16, 2021 at 7:22 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> >
> > On Tue, Mar 16, 2021 at 6:22 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> > >
> > > On Mon, Mar 15, 2021 at 6:14 PM Ajin Cherian <itsajin(at)gmail(dot)com> wrote:
> > > >
> > > > On Mon, Mar 15, 2021 at 2:04 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> > > >>
> > >
> > > 2) table_states_not_ready global variable is used immediately after
> > > call to FetchTableStates, we can make FetchTableStates return the
> > > value or get it as an argument to the function and the global
> > > variables can be removed.
> > > +static List *table_states_not_ready = NIL;
> > >
> >
> > But we do update the states in the list table_states_not_ready in
> > function process_syncing_tables_for_apply. So, the current arrangement
> > looks good to me.
>
> But I felt we can do this without using global variables.
> table_states_not_ready is used immediately after calling
> FetchTableStates in AnyTablesyncsNotREADY and
> process_syncing_tables_for_apply functions. It is not used anywhere
> else. My point was we do not need to store this in global variables as
> it is not needed elsewhere.
>

It might be possible but I am not if that is better than what we are
currently doing and moreover that is existing code and this patch has
just encapsulated in a function. Even if you think there is a better
way which I doubt, we can probably look at it as a separate patch.

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-03-17 03:23:42 Re: Getting better results from valgrind leak tracking
Previous Message Amit Kapila 2021-03-17 03:10:04 Re: subscriptionCheck failures