Re: [HACKERS] Corner case in xlog stuff: what happens exactly at a seg boundary?

2006-08-07 Thread Tom Lane
"Jim C. Nasby" <[EMAIL PROTECTED]> writes:
> Should we ask users if anyone is currently doing this? It seems pretty
> ugly to have most functions return the last used WAL byte with only
> stop_backup returning the first unused byte.

No, you misunderstood.  All the functions that return WAL location
strings use the same convention.  It's the two new functions that
convert a WAL location string to a filename that have the boundary-case
logic.

regards, tom lane

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] Corner case in xlog stuff: what happens exactly at a seg boundary?

2006-08-07 Thread Jim C. Nasby
On Sat, Aug 05, 2006 at 11:59:40PM -0400, Tom Lane wrote:
> I wrote:
> > Rather than expecting user-level scripts to get this corner case
> > right, I suggest that we ought to modify pg_stop_backup and friends
> > so that what they return is the last used byte address of WAL, not
> > the first unused byte address as now.  Then, blindly extracting
> > the filename will give the right answer about which file to archive,
> > even in the boundary case.
> 
> After further thought I desisted from that plan: changing the result
> convention of existing functions like pg_stop_backup() will break any
> existing archiving scripts that do get it right.  Instead, we can put
> the boundary-case logic into the new functions that extract a filename
> from the WAL location string that the action functions return.

Should we ask users if anyone is currently doing this? It seems pretty
ugly to have most functions return the last used WAL byte with only
stop_backup returning the first unused byte. If nothing else we should
at least plan on depricating this, probably by having a
pg_stop_backup(boolean) that lets the user specify which behavior they
want, and eventually switching pg_stop_backup() to the new behavior.

Ultimately, I'd bet that the vast majority of scripts out there blindly
do the wrong thing today and the authors aren't even aware of the issue.
-- 
Jim C. Nasby, Sr. Engineering Consultant  [EMAIL PROTECTED]
Pervasive Software  http://pervasive.comwork: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf   cell: 512-569-9461

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] Corner case in xlog stuff: what happens exactly at a seg boundary?

2006-08-07 Thread Tom Lane
Simon Riggs <[EMAIL PROTECTED]> writes:
> On Sat, 2006-08-05 at 23:59 -0400, Tom Lane wrote:
>> After further thought I desisted from that plan: changing the result
>> convention of existing functions like pg_stop_backup() will break any
>> existing archiving scripts that do get it right.  Instead, we can put
>> the boundary-case logic into the new functions that extract a filename
>> from the WAL location string that the action functions return.

> This is done right? Ping me back if there's anything more to add.

It's done unless someone wants to change what I did ... at least as
far as the code goes.  We might need more explanation in backup.sgml
about proper use of this stuff.

regards, tom lane

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] Corner case in xlog stuff: what happens exactly at a

2006-08-07 Thread Simon Riggs
On Sat, 2006-08-05 at 23:59 -0400, Tom Lane wrote:
> I wrote:
> > Rather than expecting user-level scripts to get this corner case
> > right, I suggest that we ought to modify pg_stop_backup and friends
> > so that what they return is the last used byte address of WAL, not
> > the first unused byte address as now.  Then, blindly extracting
> > the filename will give the right answer about which file to archive,
> > even in the boundary case.
> 
> After further thought I desisted from that plan: changing the result
> convention of existing functions like pg_stop_backup() will break any
> existing archiving scripts that do get it right.  Instead, we can put
> the boundary-case logic into the new functions that extract a filename
> from the WAL location string that the action functions return.

This is done right? Ping me back if there's anything more to add.

-- 
  Simon Riggs
  EnterpriseDB  http://www.enterprisedb.com


---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] Corner case in xlog stuff: what happens exactly at a seg boundary?

2006-08-05 Thread Tom Lane
I wrote:
> Rather than expecting user-level scripts to get this corner case
> right, I suggest that we ought to modify pg_stop_backup and friends
> so that what they return is the last used byte address of WAL, not
> the first unused byte address as now.  Then, blindly extracting
> the filename will give the right answer about which file to archive,
> even in the boundary case.

After further thought I desisted from that plan: changing the result
convention of existing functions like pg_stop_backup() will break any
existing archiving scripts that do get it right.  Instead, we can put
the boundary-case logic into the new functions that extract a filename
from the WAL location string that the action functions return.

regards, tom lane

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org