Hi Simon, On Thu, 17 Sep 2020 at 06:54, Simon Riggs <si...@2ndquadrant.com> wrote: > Should pg_rusage_init(&ru0); > be at the start of the REDO loop, since you only use it if we take that path?
Thanks for commenting. I may be misunderstanding your words, but as far as I see it the pg_rusage_init() is only called if we're going to go into recovery. The pg_rusage_init() and pg_rusage_show() seem to be in the same scope, so I can't quite see how we could do the pg_rusage_init() without the pg_rusage_show(). Oh wait, there's the possibility that if recoveryTargetAction == RECOVERY_TARGET_ACTION_SHUTDOWN that we'll exit before we report end of recovery. I'm pretty sure I'm misunderstanding you though. If it's easier to explain, please just post a small patch with what you mean. David