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

Re: pg_stop_backup wait bug fix

From: "Fujii Masao" <masao(dot)fujii(at)gmail(dot)com>
To: "Heikki Linnakangas" <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: "Simon Riggs" <simon(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stop_backup wait bug fix
Date: 2008-12-03 04:26:12
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Wed, Dec 3, 2008 at 5:13 AM, Heikki Linnakangas
<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> 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.

You're right. As you say, the value (stopxlogfilename) printed to the backup
history file is wrong. But, since the value is not used fortunately,
any troubles
have not come up. So, I think that we can just replace them.

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

Somewhat confusingly, BackupHistoryFileName is called only once. Isn't 1st
(which probably you thought) BackupHistoryFilePath? In order to prevent
confusion, we should add new local variable (histfilename) for the backup
history file name?


Fujii Masao
NTT Open Source Software Center

In response to


pgsql-hackers by date

Next:From: Fujii MasaoDate: 2008-12-03 05:00:20
Subject: Re: Sync Rep: First Thoughts on Code
Previous:From: Tom LaneDate: 2008-12-03 03:32:32
Subject: Re: Erroring out on parser conflicts

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