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

From Heikki Linnakangas
Subject Re: ThisTimeLineID in checkpointer and bgwriter processes
Date
Msg-id 50D34EB1.7020505@vmware.com
Whole thread Raw
In response to Re: ThisTimeLineID in checkpointer and bgwriter processes  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: ThisTimeLineID in checkpointer and bgwriter processes  (Fujii Masao <masao.fujii@gmail.com>)
Re: ThisTimeLineID in checkpointer and bgwriter processes  (Amit Kapila <amit.kapila@huawei.com>)
List pgsql-hackers
On 20.12.2012 18:19, Fujii Masao wrote:
> InstallXLogFileSegment() also uses ThisTimeLineID. But your recent commit
> doesn't take care of it and prevents the standby from recycling the WAL files
> properly. Specifically, the standby recycles the WAL file to wrong name.

A-ha, good catch. So that's actually a live bug in 9.1 and 9.2 as well: 
after the recovery target timeline has changed, restartpoints will 
continue to preallocate/recycle WAL files for the old timeline. That's 
otherwise harmless, but the useless WAL files waste space, and 
walreceiver will have to always create new files.

So instead of always running with ThisTimeLineID = 0 in the checkpointer 
process, I guess we'll have to update it to the timeline being replayed, 
when creating a restartpoint.

- Heikki



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Set visibility map bit after HOT prune
Next
From: Pavan Deolasee
Date:
Subject: Re: Set visibility map bit after HOT prune