Thread: Status of the startup process post end of recovery

Status of the startup process post end of recovery

From
Pavan Deolasee
Date:
Hello,

While doing some tests, I observed that the "ps" command continues to
display status of the startup process as "recovering <filename>" even
though it has finished the redo and is now performing end-of-recovery
checkpoint. This checkpoint can take a while, a few seconds to a few
minutes depending on the dirty buffers at the end of the recovery. The
"ps" command keep displaying a stale status for all that time. How
about calling set_ps_display() with appropriate status string, say
similar to what is logged by LogCheckpointStart() ? If we do that,
what would be the best place to add that code ? I was thinking adding
that to CreateCheckpoint() itself so that the status is displayed at
all relevant places.

Comments ?

Thanks,
Pavan

-- 
Pavan Deolasee
http://www.linkedin.com/in/pavandeolasee



Re: Status of the startup process post end of recovery

From
Andres Freund
Date:
On 2013-03-04 18:21:50 +0530, Pavan Deolasee wrote:
> Hello,
> 
> While doing some tests, I observed that the "ps" command continues to
> display status of the startup process as "recovering <filename>" even
> though it has finished the redo and is now performing end-of-recovery
> checkpoint. This checkpoint can take a while, a few seconds to a few
> minutes depending on the dirty buffers at the end of the recovery. The
> "ps" command keep displaying a stale status for all that time. How
> about calling set_ps_display() with appropriate status string, say
> similar to what is logged by LogCheckpointStart() ? If we do that,
> what would be the best place to add that code ? I was thinking adding
> that to CreateCheckpoint() itself so that the status is displayed at
> all relevant places.

That might be confusing for example in CREATE DATABASE.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



Re: Status of the startup process post end of recovery

From
Pavan Deolasee
Date:
On Mon, Mar 4, 2013 at 6:23 PM, Andres Freund <andres@2ndquadrant.com> wrote:
> On 2013-03-04 18:21:50 +0530, Pavan Deolasee wrote:
>> If we do that,
>> what would be the best place to add that code ? I was thinking adding
>> that to CreateCheckpoint() itself so that the status is displayed at
>> all relevant places.
>
> That might be confusing for example in CREATE DATABASE.
>

Yeah, you're right. StartupXLOG() seems to be a better place in that
case. We can set it before calling CreateCheckpoint() and set it back
to "" once checkpoint finishes. Or we can also set it to report the
next action such as "running recovery_end_command", but not sure if
any step beyond CHECKPOINT would really take long enough to be worth
caring for.

Thanks,
Pavan

-- 
Pavan Deolasee
http://www.linkedin.com/in/pavandeolasee