Re: Is Recovery actually paused?

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: dilipbalaut(at)gmail(dot)com
Cc: robertmhaas(at)gmail(dot)com, bharath(dot)rupireddyforpostgres(at)gmail(dot)com, nagata(at)sraoss(dot)co(dot)jp, sawada(dot)mshk(at)gmail(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org, simon(at)2ndquadrant(dot)com
Subject: Re: Is Recovery actually paused?
Date: 2021-02-25 07:12:25
Message-ID: 20210225.161225.2118728952883447129.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Thu, 25 Feb 2021 09:49:15 +0530, Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote in
> On Thu, Feb 25, 2021 at 6:52 AM Kyotaro Horiguchi
> <horikyota(dot)ntt(at)gmail(dot)com> wrote:
>
> > Recently we have mildly changed to the direction to utilize the
> > compiler warning about enum coverage in switch struct. (Maybe we need
> > another compiler option that enables that check for switch'es with the
> > default case, though.) In that light, the direction is a switch
> > without the default case then Assert if none of the cases is stepped
> > on. This is what apply_dispatch does. Slightly different version of
> > the same would be the following. This is more natural than the above.
> >
> > statestr = NULL;
> > swtich(state)
> > {
> > case RECOVERY_NOT_PAUSED:
> > statestr = "not paused";
> > break;
> > ...
> > }
> >
> > Assert (statestr != NULL);
> > return cstring_to_text(statestr);
> >
> > If the enum had many (more than ten or so?) values and it didn't seem
> > stable I push that a bit strongly but it actually consists of only
> > three values and not likely to get further values. So I don't insist
> > on the style so strongly here.
> >
>
> Changed as per the suggestion.

Thanks for your patience and sorry for having annoyed you.

The latest version applies (almost) cleanly to the current master and
works fine.
I don't have further comment on this.

I'll wait for a day before marking this RfC in case anyone have
further comments.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2021-02-25 07:52:53 Re: Is Recovery actually paused?
Previous Message Peter Smith 2021-02-25 07:02:05 Re: [HACKERS] logical decoding of two-phase transactions