Re: ThisTimeLineID in checkpointer and bgwriter processes - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: ThisTimeLineID in checkpointer and bgwriter processes
Date
Msg-id 005a01cdde99$f4690be0$dd3b23a0$@kapila@huawei.com
Whole thread Raw
In response to ThisTimeLineID in checkpointer and bgwriter processes  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: ThisTimeLineID in checkpointer and bgwriter processes  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
On Wednesday, December 19, 2012 9:30 PM Heikki Linnakangas wrote:
> In both checkpointer.c and bgwriter.c, we do this before entering the
> main loop:
> 
>         /*
>           * Use the recovery target timeline ID during recovery
>           */
>          if (RecoveryInProgress())
>                  ThisTimeLineID = GetRecoveryTargetTLI();
> 
> That seems reasonable. However, since it's only done once, when the
> process starts up, ThisTimeLineID is never updated in those processes,
> even though the startup process changes recovery target timeline.
> 
> That actually seems harmless to me, and I also haven't heard of any
> complaints of misbehavior in 9.1 or 9.2 caused by that. I'm not sure
> why
> we bother to set ThisTimeLineID in those processes in the first place.

This is used in RemoveOldXlogFiles(), so if during recovery when it's not
set and
this function gets called, it might have some problem. 
I think it could get called from CreateRestartPoint() during recovery.


With Regards,
Amit Kapila.




pgsql-hackers by date:

Previous
From: Dave Page
Date:
Subject: EDB hosted buildfarm animals - extended downtime
Next
From: Groshev Andrey
Date:
Subject: Re: [GENERAL] trouble with pg_upgrade 9.0 -> 9.1