Re: [PATCH] Patch to compute Max LSN of Data Pages

Amit Kapila <amit.kapila@huawei.com>

From: Amit Kapila <amit.kapila@huawei.com>
To: "'Fujii Masao'" <masao.fujii@gmail.com>
Cc: "'Alvaro Herrera'" <alvherre@2ndquadrant.com>, "'Robert Haas'" <robertmhaas@gmail.com>, <pgsql-hackers@postgresql.org>
Date: 2012-11-15T05:08:37Z
Lists: pgsql-hackers
On Wednesday, November 14, 2012 10:19 PM Fujii Masao wrote:
> On Thu, Nov 15, 2012 at 12:55 AM, Amit Kapila <amit.kapila@huawei.com>
> wrote:
> > Now user can use this utility to decide if new-standby has max LSN
> greater
> 
> > And that situation can occur when new-standby has startpoint LSN
> greater
> > than new-master?
> 
> Whether the backup is required has nothing to do with the startpoint.
> The backup is required when the data page in old-master precedes
> the last applied LSN in old-standby (i.e., new-master) at the moment
> of the failover. Without the backup, there is no way to revert the data
> which is ahead of new-master.

Okay. 
So as Robert and Alvaro suggested to have it separate utility rather than
having options in pg_resetxlog to print MAX LSN seems to be quite
appropriate.
I am planning to update the patch to make it a separate utility as
pg_computemaxlsn with options same as what I have proposed for pg_resetxlog
to print MAX LSN.
So considering it a separate utility there can be 2 options:
a. have a utility in contrib.
b. have a utility in bin similar to pg_resetxlog.
	
What is the best place to have it?

With Regards,
Amit Kapila.