FWIW, I restate this (perhaps) more clearly.
At Wed, 15 Jan 2020 11:02:24 +0900 (JST), Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote in
> recvoery_target_* is not cleared after startup. If a server crashed
> just after the last shutdown checkpoint, any recovery_target_* setting
> prevents the server from starting regardless of its value.
recvoery_target_* is not automatically cleared after a successful
archive recovery. After that, if the server crashed just after the
last shutdown checkpoint, any recovery_target_* setting prevents the
server from starting regardless of its value.
> > LOG: database system was not properly shut down; automatic recovery in progress
> > LOG: invalid record length at 0/9000420: wanted 24, got 0
> (recovery is skipped)
> > FATAL: recovery ended before configured recovery target was reached
>
> I think we should ignore the setting while crash recovery. Targeted
> recovery mode is documented as a feature of archive recovery. Perhaps
> ArchiveRecoveryRequested is needed in the condition.
>
> > if (ArchiveRecoveryRequested &&
> > recoveryTarget != RECOVERY_TARGET_UNSET && !reachedStopPoint)
regards.
--
Kyotaro Horiguchi
NTT Open Source Software Center