Skip site navigation (1) Skip section navigation (2)

Re: pg_stop_backup wait bug fix

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stop_backup wait bug fix
Date: 2008-12-02 20:13:02
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Fujii Masao wrote:
> On Wed, Oct 8, 2008 at 10:23 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
>> Minor bug fix for pg_stop_backup() to prevent it waiting longer than
>> necessary in certain circumstances.
> Why don't you use XLByteToPrevSeg like pg_xlogfile_name?
> I think that we should uniform the logic as much as possible.

Agreed, should use XLByteToPrevSeg. But I wonder if we can just replace 
the current XLByteToSeg call with XLByteToPrevSeg? That would offset the 
return value of the function by one byte as well, as well as the value 
printed to the backup history file. In fact, I think the original patch 
got that wrong; it would return the location of the *beginning* of the 
last xlog file.

I also noticed that the 2nd BackupHistoryFileName call in that function 
is useless; histfilepath variable is already filled in earlier.

How does the attached patch look to you? Do you have an easy way to test 

   Heikki Linnakangas

Attachment: pg_stop_backup_wait-heikki-1.patch
Description: text/x-diff (1.8 KB)

In response to


pgsql-hackers by date

Next:From: Bruce MomjianDate: 2008-12-02 20:39:47
Subject: Re: Simple postgresql.conf wizard
Previous:From: Simon RiggsDate: 2008-12-02 19:21:18
Subject: Re: Sync Rep: First Thoughts on Code

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group