Re: TODO: Split out pg_resetxlog output into pre- and post-sections

From: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: TODO: Split out pg_resetxlog output into pre- and post-sections
Date: 2013-11-25 03:47:12
Message-ID: BF2827DCCE55594C8D7A8F7FFD3AB7713DDAD5B8@SZXEML508-MBX.china.huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Nov 9, 2013, Amit Kapila wrote

> On Fri, Nov 8, 2013 at 10:37 AM, Rajeev rastogi

> <rajeev(dot)rastogi(at)huawei(dot)com<mailto:rajeev(dot)rastogi(at)huawei(dot)com>> wrote:

> > On Fri, 08 November 2013 09:47

> >

> >> On Tue, Nov 5, 2013 at 3:20 PM, Rajeev rastogi

> >> <rajeev(dot)rastogi(at)huawei(dot)com<mailto:rajeev(dot)rastogi(at)huawei(dot)com>> wrote:

> >> > On execution of pg_resetxlog using the option -n

> >> >

> >> > Please provide your opinion or expectation out of this patch.

> >>

> >> Your approach in patch seems to be inline with Todo item. On a

> >> quick glance, I observed few things which can make your patch better:

> >>

> >> 1. The purpose was to print pg_control values in one section and

> >> any other reset values in different section, so in that

> >> regard, should we display below in new section, as here

> >> newXlogSegNo is not directly from pg_control.

> >>

> >> PrintControlValues()

> >> {

> >> ..

> >> XLogFileName(fname, ControlFile.checkPointCopy.ThisTimeLineID,

> >> newXlogSegNo);

> >>

> >> printf(_("First log segment after reset: %s\n"),

> >> fname);

> >> }

> >

> > Yes we can print newXlogSegNo.

>

> I think then your documentation also need updates.

I have added to documentation.

>

> One more thing, I think as per this patch few parameters will be

> displayed twice once in "pg_control values .." section and once in

> "Values to be used after reset:", so by doing this I guess you want to

> make it easier for user to refer both pg_control's original/guessed

> value and new value after reset. Here I wonder if someone wants to

> refer to original values, can't he directly use pg_controldata? Anyone

> else have thoughts about how can we display values which can make

> current situation better for user.

Aim of this patch is to:

1. Without this patch, if I give some parameter using -l switch and also provide -n switch

Then it will display this values as "TimeLineID of latest checkpoint", which is not

Really the truth.

1. So we can print both actual values and values to be used after reset in different section

So that is extra clear.

Usage of pg_controldata may not be preferable in this case because:

1. User will have to use two separate executable, which can be actually achieved by only pg_resetxlog.

2. pg_controldata prints many other additional parameters, in which user may not be interested.

I have attached the updated patch.

Please let me know if it is OK or anyone else have any other idea.

Note: Replied this mail on 11th Nov also but for some reason didn't appear in community mail chain.

Thanks and Regards,

Kumar Rajeev Rastogi

Attachment Content-Type Size
pg_resetxlogsectionV2.patch application/octet-stream 8.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Khandekar 2013-11-25 04:00:07 Re: COPY table FROM STDIN doesn't show count tag
Previous Message Amit Kapila 2013-11-25 03:46:49 Re: Re: Server is not getting started with log level as debug5 on master after commit 3147ac