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

From Heikki Linnakangas
Subject ThisTimeLineID in checkpointer and bgwriter processes
Date
Msg-id 50D1E493.3040800@vmware.com
Whole thread Raw
Responses Re: ThisTimeLineID in checkpointer and bgwriter processes
List pgsql-hackers
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. I 
think we did it when streaming replication was introduced because it was 
an easy thing to do, because back then recovery target timeline never 
changed after recovery was started. But now that it can change, I don't 
think that makes sense anymore.

So, I propose that we simply remove those, and leave ThisTimeLineID at 
zero in checkpointer and bgwriter processes, while we're still in 
recovery. ThisTimeLineID is updated anyway before performing the first 
checkpoint after finishing recovery, and AFAICS that's the first time 
the value is needed.

- Heikki



pgsql-hackers by date:

Previous
From: Pavan Deolasee
Date:
Subject: Re: Set visibility map bit after HOT prune
Next
From: Andrew Dunstan
Date:
Subject: Re: [ADMIN] Problems with enums after pg_upgrade