ThisTimeLineID in checkpointer and bgwriter processes

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема ThisTimeLineID in checkpointer and bgwriter processes
Дата
Msg-id 50D1E493.3040800@vmware.com
обсуждение исходный текст
Ответы Re: ThisTimeLineID in checkpointer and bgwriter processes  (Amit Kapila <amit.kapila@huawei.com>)
Список 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 по дате отправления:

Предыдущее
От: Pavan Deolasee
Дата:
Сообщение: Re: Set visibility map bit after HOT prune
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: [ADMIN] Problems with enums after pg_upgrade