Re: [HACKERS] PreallocXlogFiles

2004-07-24 Thread Simon Riggs
On Sat, 2004-07-24 at 15:22, Tom Lane wrote: > Simon Riggs <[EMAIL PROTECTED]> writes: > > Calling PreallocXlogFiles outside of the Checkpoint code is > > straightforward to initiate from bgwriter.c, but the caller must have > > already obtained the current recptr position. That would require > > a

Re: [HACKERS] PreallocXlogFiles

2004-07-24 Thread Tom Lane
Simon Riggs <[EMAIL PROTECTED]> writes: > Calling PreallocXlogFiles outside of the Checkpoint code is > straightforward to initiate from bgwriter.c, but the caller must have > already obtained the current recptr position. That would require > attempting to gain a lock on XLogCtl, then releasing it

Re: [HACKERS] PreallocXlogFiles

2004-07-24 Thread Simon Riggs
On Thu, 2004-07-22 at 15:19, Tom Lane wrote: > Simon Riggs <[EMAIL PROTECTED]> writes: > > On Thu, 2004-07-22 at 01:44, Tom Lane wrote: > >> Agreed. Maybe it should be part of the bgwriter's idle loop, and > >> not directly associated with checkpoints at all. > > > Yes, thats a more natural home,

Re: [HACKERS] PreallocXlogFiles

2004-07-22 Thread Tom Lane
Simon Riggs <[EMAIL PROTECTED]> writes: > On Thu, 2004-07-22 at 01:44, Tom Lane wrote: >> Agreed. Maybe it should be part of the bgwriter's idle loop, and >> not directly associated with checkpoints at all. > Yes, thats a more natural home, now bgwriter exists. But does it know > when log files a

Re: [HACKERS] PreallocXlogFiles

2004-07-22 Thread Simon Riggs
On Thu, 2004-07-22 at 01:44, Tom Lane wrote: > Simon Riggs <[EMAIL PROTECTED]> writes: > > Yes, I agree, but the checkpointer isn't waking up often enough > > currently to do this effectively. It's just randomly doing it. > > Agreed. Maybe it should be part of the bgwriter's idle loop, and > not

Re: [HACKERS] PreallocXlogFiles

2004-07-21 Thread Tom Lane
Simon Riggs <[EMAIL PROTECTED]> writes: > Yes, I agree, but the checkpointer isn't waking up often enough > currently to do this effectively. It's just randomly doing it. Agreed. Maybe it should be part of the bgwriter's idle loop, and not directly associated with checkpoints at all.

Re: [HACKERS] PreallocXlogFiles

2004-07-21 Thread Simon Riggs
On Thu, 2004-07-22 at 00:35, Gavin Sherry wrote: > On Wed, 21 Jul 2004, Simon Riggs wrote: > > > I notice this: > > > > When a checkpoint occurs, if a log file is more than 75% full then a new > > file will be allocated (in PreallocXlogFiles). > > > > This assumes we checkpoint at least 4 times pe

Re: [HACKERS] PreallocXlogFiles

2004-07-21 Thread Tom Lane
Simon Riggs <[EMAIL PROTECTED]> writes: > I would like to remove PreallocXlogFiles on the basis that it is dead, > or at least pointless code. It could stand improvement I'm sure, but it's not pointless, particularly not when you have archive mode turned on and so dead xlog segments can't necessar

Re: [HACKERS] PreallocXlogFiles

2004-07-21 Thread Gavin Sherry
On Wed, 21 Jul 2004, Simon Riggs wrote: > I notice this: > > When a checkpoint occurs, if a log file is more than 75% full then a new > file will be allocated (in PreallocXlogFiles). > > This assumes we checkpoint at least 4 times per log file, otherwise it > will be effectively random whether we

[HACKERS] PreallocXlogFiles

2004-07-21 Thread Simon Riggs
I notice this: When a checkpoint occurs, if a log file is more than 75% full then a new file will be allocated (in PreallocXlogFiles). This assumes we checkpoint at least 4 times per log file, otherwise it will be effectively random whether we actually ever do this or not. With an uneven or burs