Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 63EE7633927 for ; Wed, 17 Feb 2010 04:42:33 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 18668-05-6 for ; Wed, 17 Feb 2010 08:42:18 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from serv2.oss.ntt.co.jp (serv2.oss.ntt.co.jp [222.151.198.100]) by mail.postgresql.org (Postfix) with ESMTP id 90C6C63380A for ; Wed, 17 Feb 2010 04:41:58 -0400 (AST) Received: from serv2.oss.ntt.co.jp (localhost [127.0.0.1]) by serv2.oss.ntt.co.jp (Postfix) with ESMTP id E8EB62482A5; Wed, 17 Feb 2010 17:41:56 +0900 (JST) Received: from serv1.oss.ntt.co.jp (serv1.oss.ntt.co.jp [172.19.0.2]) by serv2.oss.ntt.co.jp (Postfix) with ESMTP id D708B24827E; Wed, 17 Feb 2010 17:41:56 +0900 (JST) Received: from [172.17.1.163] (unknown [172.17.1.163]) by serv1.oss.ntt.co.jp (Postfix) with ESMTP id B7FEE11C0A3; Wed, 17 Feb 2010 17:41:56 +0900 (JST) Date: Wed, 17 Feb 2010 17:43:19 +0900 From: Takahiro Itagaki To: PostgreSQL-development Subject: Re: Re: [BUGS] BUG #4566: pg_stop_backup() reports incorrect STOP WAL LOCATION Cc: Fujii Masao In-Reply-To: <3f0b79eb1002152119m2be4a818x4b72172d27892f@mail.gmail.com> References: <20100205090834.9BE7.52131E4D@oss.ntt.co.jp> <3f0b79eb1002152119m2be4a818x4b72172d27892f@mail.gmail.com> Message-Id: <20100217174319.A5C1.52131E4D@oss.ntt.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.53 [ja] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.458 tagged_above=-10 required=5 tests=AWL=0.141, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201002/1429 X-Sequence-Number: 157772 I'd like to apply the patch to HEAD and previous releases because the issue seems to be a bug in the core. Any comments or objections? Some users actually use STOP WAL LOCATION in their backup script, and they've countered the bug with 1/256 probability in recent days. Fujii Masao wrote: > On Fri, Feb 5, 2010 at 9:08 AM, Takahiro Itagaki > wrote: > > > > Fujii Masao wrote: > > > >> On Fri, Dec 5, 2008 at 11:41 PM, Randy Isbell wrote: > >> > An inconsistency exists between the segment name reported by > >> > pg_stop_backup() and the actual WAL file name. > >> > > >> > START WAL LOCATION: 10/FE1E2BAC (file 0000000200000010000000FE) > >> > STOP WAL LOCATION: 10/FF000000 (file 0000000200000010000000FF) > > > >> But it was rejected because its change might break the existing app. > > > > It might break existing applications if it returns "FE" instead of "FF", > > but never-used filename surprises users. (IMO, the existing apps probably > > crash if "FF" returned, i.e, 1/256 of the time.) > > > > Should it return the *next* reasonable log filename instead of "FF"? > > For example, 000000020000002000000000 for the above case. > > Here is the patch that avoids a nonexistent file name, according to > Itagaki-san's suggestion. If we are crossing a logid boundary, the > next reasonable file name is used instead of a nonexistent one. Regards, --- Takahiro Itagaki NTT Open Source Software Center