Re: [HACKERS] ThisTimeLineID in checkpointer and bgwriter processes

2012-12-21 Thread Heikki Linnakangas
On 21.12.2012 08:18, Amit Kapila wrote: On Thursday, December 20, 2012 11:15 PM Heikki Linnakangas wrote: 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

Re: [HACKERS] ThisTimeLineID in checkpointer and bgwriter processes

2012-12-20 Thread Amit Kapila
On Thursday, December 20, 2012 11:15 PM Heikki Linnakangas wrote: > 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,

Re: [HACKERS] ThisTimeLineID in checkpointer and bgwriter processes

2012-12-20 Thread Fujii Masao
On Fri, Dec 21, 2012 at 2:45 AM, Heikki Linnakangas wrote: > 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 st

Re: [HACKERS] ThisTimeLineID in checkpointer and bgwriter processes

2012-12-20 Thread Heikki Linnakangas
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 ac

Re: [HACKERS] ThisTimeLineID in checkpointer and bgwriter processes

2012-12-20 Thread Andres Freund
On 2012-12-20 16:46:21 +, Simon Riggs wrote: > On 20 December 2012 13:19, Amit Kapila wrote: > > > True, it might not have any functionality effect in RemoveOldXlogFiles(). > > However it can be used in PreallocXlogFiles()->XLogFileInit() as well. > > Which is never called in recovery because

Re: [HACKERS] ThisTimeLineID in checkpointer and bgwriter processes

2012-12-20 Thread Fujii Masao
On Fri, Dec 21, 2012 at 1:46 AM, Simon Riggs wrote: > On 20 December 2012 13:19, Amit Kapila wrote: > >> True, it might not have any functionality effect in RemoveOldXlogFiles(). >> However it can be used in PreallocXlogFiles()->XLogFileInit() as well. > > Which is never called in recovery becaus

Re: [HACKERS] ThisTimeLineID in checkpointer and bgwriter processes

2012-12-20 Thread Simon Riggs
On 20 December 2012 16:21, Tom Lane wrote: > Simon Riggs writes: >> PreallocXlogFiles() should have been put to the sword long ago. It's a >> performance tweak aimed at people without a performance problem in >> this area. > > This claim seems remarkably lacking in any supporting evidence. > > I'

Re: [HACKERS] ThisTimeLineID in checkpointer and bgwriter processes

2012-12-20 Thread Simon Riggs
On 20 December 2012 13:19, Amit Kapila wrote: > True, it might not have any functionality effect in RemoveOldXlogFiles(). > However it can be used in PreallocXlogFiles()->XLogFileInit() as well. Which is never called in recovery because we never write WAL. -- Simon Riggs htt

Re: [HACKERS] ThisTimeLineID in checkpointer and bgwriter processes

2012-12-20 Thread Tom Lane
Simon Riggs writes: > PreallocXlogFiles() should have been put to the sword long ago. It's a > performance tweak aimed at people without a performance problem in > this area. This claim seems remarkably lacking in any supporting evidence. I'll freely grant that PreallocXlogFiles could stand to b

Re: [HACKERS] ThisTimeLineID in checkpointer and bgwriter processes

2012-12-20 Thread Fujii Masao
On Thu, Dec 20, 2012 at 8:41 PM, Heikki Linnakangas wrote: > On 20.12.2012 12:08, Amit Kapila wrote: >> >> 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: >>> >>> /* >>>

Re: [HACKERS] ThisTimeLineID in checkpointer and bgwriter processes

2012-12-20 Thread Amit Kapila
On Thursday, December 20, 2012 7:03 PM Simon Riggs wrote: > On 20 December 2012 13:19, Amit Kapila wrote: > > >> So I think we're good on that front. But I'll add a comment there, > and > >> use 0 explicitly instead of ThisTimeLineID, for clarity. > > > > True, it might not have any functionality

Re: [HACKERS] ThisTimeLineID in checkpointer and bgwriter processes

2012-12-20 Thread Andres Freund
On 2012-12-20 13:32:36 +, Simon Riggs wrote: > On 20 December 2012 13:19, Amit Kapila wrote: > > >> So I think we're good on that front. But I'll add a comment there, and > >> use 0 explicitly instead of ThisTimeLineID, for clarity. > > > > True, it might not have any functionality effect in R

Re: [HACKERS] ThisTimeLineID in checkpointer and bgwriter processes

2012-12-20 Thread Simon Riggs
On 20 December 2012 13:19, Amit Kapila wrote: >> So I think we're good on that front. But I'll add a comment there, and >> use 0 explicitly instead of ThisTimeLineID, for clarity. > > True, it might not have any functionality effect in RemoveOldXlogFiles(). > However it can be used in PreallocXlo

Re: [HACKERS] ThisTimeLineID in checkpointer and bgwriter processes

2012-12-20 Thread Amit Kapila
On Thursday, December 20, 2012 5:12 PM Heikki Linnakangas wrote: > On 20.12.2012 12:08, Amit Kapila wrote: > > 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: > >> > >> /* > >>

Re: [HACKERS] ThisTimeLineID in checkpointer and bgwriter processes

2012-12-20 Thread Heikki Linnakangas
On 20.12.2012 12:08, Amit Kapila wrote: 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 (Rec

Re: [HACKERS] ThisTimeLineID in checkpointer and bgwriter processes

2012-12-20 Thread Amit Kapila
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()) >

[HACKERS] ThisTimeLineID in checkpointer and bgwriter processes

2012-12-19 Thread Heikki Linnakangas
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