pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <amit.kapila@huawei.com>
To: hlinnaka@iki.fi
To: 'Fujii Masao' <masao.fujii@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7533: Client is not able to connect cascade standby incase basebackup is taken from hot standby
Date: Thu, 13 Sep 2012 18:48:47 +0530
Message-ID: <007201cd91b2$4f1e89a0$ed5b9ce0$@kapila@huawei.com> (raw)
In-Reply-To: <5051CFD2.60103@iki.fi>
References: <E1TBlPY-0003Do-75@wrigleys.postgresql.org>
	<CAHGQGwGSOtV+RfJG4GOCtLb2pDEAhLKO+mBw05Z2H0mW=x0eDQ@mail.gmail.com>
	<5051CFD2.60103@iki.fi>

On Thursday, September 13, 2012 5:52 PM Heikki Linnakangas wrote:
On 12.09.2012 22:03, Fujii Masao wrote:
> On Wed, Sep 12, 2012 at 8:47 PM,<amit.kapila@huawei.com>  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.
>>

>Hmm, I think the CheckRecoveryConsistency() call in the redo loop is misplaced. It's called after we got a record from 
> ReadRecord, but *before* replaying it (rm_redo). Even if replaying record X makes the system consistent, we won't check 
> and notice that until we have fetched record X+1. In this particular test case, record X is a shutdown checkpoint 
> record, but it could as well be a running-xacts record, or the record that reaches minRecoveryPoint.

> Does the problem go away if you just move the CheckRecoveryConsistency() call *after* rm_redo (attached)?

This will resolve the problem I have reported but moving down might create another problem as due to function
recoveryPauseHere(), the recovery might get paused and in current code a client might be able to connect even in that state as  CheckRecoveryConsistency() is done before that. However after suggested change it might happen that Client will not be able to connect.
If you see any problem in what I explain then can we think of calling CheckRecoveryConsistency() both at current place and the place you have proposes. If my description doesn't make any sense (as that is only my suspicion) then we can move the function down and fix the defect.

Thank you for giving so quick response about the defect.

With Regards,
Amit Kapila.





view thread (10+ messages)  latest in thread

Message-ID: <007201cd91b2$4f1e89a0$ed5b9ce0$@kapila@huawei.com>
Permalink:  ../007201cd91b2$4f1e89a0$ed5b9ce0$@kapila@huawei.com/
Also on:    postgresql.org/message-id/007201cd91b2$4f1e89a0$ed5b9ce0$@kapila@huawei.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: amit.kapila@huawei.com, hlinnaka@iki.fi, masao.fujii@gmail.com
  Subject: Re: BUG #7533: Client is not able to connect cascade standby incase basebackup is taken from hot standby
  In-Reply-To: <007201cd91b2$4f1e89a0$ed5b9ce0$@kapila@huawei.com>
  References: <E1TBlPY-0003Do-75@wrigleys.postgresql.org> <CAHGQGwGSOtV+RfJG4GOCtLb2pDEAhLKO+mBw05Z2H0mW=x0eDQ@mail.gmail.com> <5051CFD2.60103@iki.fi> <007201cd91b2$4f1e89a0$ed5b9ce0$@kapila@huawei.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox