(nice work about ubsan)
At Wed, 23 Mar 2022 10:42:03 -0700, Andres Freund <andres@anarazel.de> wrote in
> Hi,
>
> On 2022-03-23 17:27:50 +0900, Kyotaro Horiguchi wrote:
> > At Mon, 21 Mar 2022 14:30:17 -0700, Andres Freund <andres@anarazel.de> wrote in
> > Before there, InitWalRecovery changes the state to
> > DB_IN_ARCHIVE_RECOVERY if it was either DB_SHUTDOWNED or
> > DB_IN_PRODUCTION. So the stat seems like always discarded on standby.
>
> Hm. I though it worked at some point. I guess there's a reason this commit is
> a separate commit marked WIP ;)
Yeah, I know:p
> > In the first place, I'm not sure it is valid that a standby from a
> > cold backup takes over the stats from the primary.
>
> I don't really see a reason not to use the stats in that case - we have a
> correct stats file after all. But it doesn't seem too important. What I
> actually find worth addressing is the case of standbys starting in
> DB_SHUTDOWNED_IN_RECOVERY. Right now we always throw stats away after a
> *graceful* restart of a standby, which doesn't seem great.
It undoubtfully an improvement if stats preserved after a graceful
restart on standbys. I just wonder if there's way to detect the
first-start of a standby from a cold backup. But even if there isn't,
it's an improvement.
regards.
--
Kyotaro Horiguchi
NTT Open Source Software Center