Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TGQdt-0006WW-HE for pgsql-bugs@postgresql.org; Tue, 25 Sep 2012 08:37:21 +0000 Received: from szxga02-in.huawei.com ([119.145.14.65]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TGQdq-0008Qm-HR for pgsql-bugs@postgresql.org; Tue, 25 Sep 2012 08:37:21 +0000 Received: from 172.24.2.119 (EHLO szxeml210-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id APP38595; Tue, 25 Sep 2012 16:36:55 +0800 (CST) Received: from SZXEML420-HUB.china.huawei.com (10.82.67.159) by szxeml210-edg.china.huawei.com (172.24.2.183) with Microsoft SMTP Server (TLS) id 14.1.323.3; Tue, 25 Sep 2012 16:35:53 +0800 Received: from blrprnc09ns (10.18.96.98) by szxeml420-hub.china.huawei.com (10.82.67.159) with Microsoft SMTP Server id 14.1.323.3; Tue, 25 Sep 2012 16:35:48 +0800 From: Amit Kapila To: "'Fujii Masao'" , CC: References: <5051CFD2.60103@iki.fi> <5052a307.a85e320a.166f.ffff8b81SMTPIN_ADDED@mx.google.com> In-Reply-To: Subject: Re: BUG #7533: Client is not able to connect cascade standby incase basebackup is taken from hot standby Date: Tue, 25 Sep 2012 14:05:47 +0530 Message-ID: <006401cd9af8$c36f4a70$4a4ddf50$@kapila@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac2TCOG+SnaUYp7+SHCcwrQAkLfVZQH7urQA Content-Language: en-us X-Originating-IP: [10.18.96.98] X-CFilter-Loop: Reflected X-Pg-Spam-Score: -1.7 (-) X-Archive-Number: 201209/258 X-Sequence-Number: 34252 On Saturday, September 15, 2012 11:41 AM Fujii Masao wrote: > On Fri, Sep 14, 2012 at 12:21 PM, Amit Kapila > wrote: > > On Thursday, September 13, 2012 10:32 PM Fujii Masao wrote: > > On Thu, Sep 13, 2012 at 9:21 PM, Heikki Linnakangas > wrote: > >> On 12.09.2012 22:03, Fujii Masao wrote: > >>> > >>> On Wed, Sep 12, 2012 at 8:47 PM, wrote: > >>>> > >>>> The following bug has been logged on the website: > >>>> > >>>> Bug reference: 7533 > >>>> Logged by: Amit Kapila > >>>> Email address: amit.kapila@huawei.com > >>>> PostgreSQL version: 9.2.0 > >>>> Operating system: Suse > >>>> Description: > >>>> > >>>> M host is primary, S host is standby and CS host is cascaded > standby. > >>>> > >> > > > > > > > >> No, at least in my case. When recovery starts at shutdown checkpoint > record and > >> there is no record following the shutdown checkpoint, recovery gets > in > >> wait state > >> before entering the main redo apply loop. That is, recovery starts > waiting for > >> new WAL record to arrive, in ReadRecord just before the redo loop. > So moving > >> the CheckRecoveryConsistency() call after rm_redo cannot fix the > problem which > >>I reported. To fix the problem, we need to make the recovery reach > the > >> consistent > >> point before the redo loop, i.e., in the CheckRecoveryConsistency() > >> just before the redo loop. > > > > I think may be in that case we need both the fixes, as the problem I > have reported can be fixed with Heikki's patch. > > Agreed. And we should just add the CheckRecoveryConsistency() call > after rm_redo > rather than moving it, as you suggested upthread. If anybody doesn't have objection, then can we fix this in code. Basically have the patch suggested by Heikki with some modifications and Fujii's patch as fix of this defect and if it's agreed upon, I can combine both the fixes and prepare a single patch as fix of this defect. With Regards, Amit Kapila.