Re: [PATCH] Patch to compute Max LSN of Data Pages - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: [PATCH] Patch to compute Max LSN of Data Pages
Date
Msg-id 019d01cdc243$0ec807c0$2c581740$@kapila@huawei.com
Whole thread Raw
In response to Re: [PATCH] Patch to compute Max LSN of Data Pages  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
On Tuesday, November 13, 2012 10:17 PM Fujii Masao wrote:
> On Tue, Nov 13, 2012 at 1:23 PM, Amit kapila <amit.kapila@huawei.com>
> wrote:
> > On Monday, November 12, 2012 9:56 PM Alvaro Herrera wrote:
> > Robert Haas escribió:
> >> On Tue, Jul 31, 2012 at 8:09 AM, Amit kapila <amit.kapila@huawei.com>
> wrote:
> >
> >>> >> I think I can see all of those things being potentially useful.
> There
> >>> >> are a couple of pending patches that will revise the WAL format

> >>> I wonder if we shouldn't make this a separate utility, rather than
> >>> something that is part of pg_resetxlog.  Anyone have a thought on
> that
> >>> topic?
> >
> >> That thought did cross my mind too.
> >
> We might be able to use this utility to decide whether we need to take
> a fresh backup from the master onto the standby, to start old master
> as new standby after failover.
>
> When starting new standby after failover, any data page in the standby
> must
> not precede the master. Otherwise, the standby cannot catch up with the
> master
> consistently. But, the master might write the data page corresponding to
> the WAL which has not been replicated to the standby yet. So, if
> failover happens
> before that WAL has been replicated, the data page in old master would
> precede
> new master (i.e., old standby), and in this case the backup is required.
> OTOH,
> if maximum LSN in data page in the standby is less than the master, the
> backup
> is not required.

When new standby will start the replication (RequestXLogStreaming()), it
will
send the startpoint, so won't in above scenario that startpoint will be
ahead of new master
(or new master won't have that LSN) and replication will not be
eastablished?

So now user may not be able to decide whether he needs to do incremental or
full backup from new master,
is this the case you are trying to point?

> Without this utility, it's difficult to calculate the maximum LSN of
> data page, so
> basically we needed to take a backup when starting the standby. In the
> future,
> thanks to this utility, we can calculate the maximum LSN, and can skip a
> backup
> if that LSN is less than the master (i.e., last applied LSN, IOW,
> timeline switch LSN).

With Regards,
Amit Kapila.




pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Memory leaks in record_out and record_send
Next
From: Palle Girgensohn
Date:
Subject: Why does delete from table where not exists (select 1 from ... LIMIT 1) perform badly?