Re: PreallocXlogFiles - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: PreallocXlogFiles
Date
Msg-id 1090701065.3057.113.camel@localhost.localdomain
Whole thread Raw
In response to Re: PreallocXlogFiles  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sat, 2004-07-24 at 15:22, Tom Lane wrote:
> Simon Riggs <simon@2ndquadrant.com> 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 quickly after
> > having read the pointer. Then call Prealloc...
> 
> When I said "modified version", I meant that we'd change the function
> to make it self-contained.  Passing an already-obtained recptr is
> convenient when it's being invoked at the end of Checkpoint, but to
> be called from the bgwriter loop it should just get the necessary lock
> and fetch the pointer for itself.
> 

Whichever...I envisaged a new wrapper function in xlog.c, called from
bgwriter.c, rather than changing Prealloc..

Your way sounds better. Leave parms the same, just put an if
recptr==NULL then {get recptr} section of code.

Main point: nearly out of time, if I'm to finish other things on
must-complete list: docs and backup start/end function design.

Best Regards, Simon Riggs



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: make LockRelation use top transaction ID
Next
From: Tom Lane
Date:
Subject: Sketch of extending error handling for subtransactions in functions