Re: pg_resetxlog to clear backup start/end locations.

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_resetxlog to clear backup start/end locations.
Date: 2014-06-25 03:32:42
Message-ID: CAHGQGwGcFYEciXFnJ5eGJUj4H=94A=j6iqaCHt3O96tMMOmA3Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 25, 2014 at 11:13 AM, Kyotaro HORIGUCHI
<horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> Hello,
>
>> Ok, I'm doing modify it to reset backup locations by default and
>> remove the new option '-b' to do that. Since this seems looking
>> to be a bug for the poeple, I'll provide backpatches back
>> to... 8.4? (Final release of 8.4 is scheduled at July 2014)
>
> I looked closer to pg_resetxlog and found I'm feeling discomfort
> of its behavior.
>
> "pg_resetxlog -n", which is explained in its help that "no
> update, just show what would be done (for testing) ", shows
> current values then values to be changed, like this.
>
> | Current pg_control values:
> |
> | pg_control version number: 942
> | Catalog version number: 201406181
> | Database system identifier: 6026883474640211951
> | Latest checkpoint's TimeLineID: 1
> | Latest checkpoint's full_page_writes: on
> | Latest checkpoint's NextXID: 0/1831
> | Latest checkpoint's NextOID: 32772
> | Latest checkpoint's NextMultiXactId: 1
> | Latest checkpoint's NextMultiOffset: 0
> | Latest checkpoint's oldestXID: 1800
> | Latest checkpoint's oldestXID's DB: 1
> | Latest checkpoint's oldestActiveXID: 0
> | Latest checkpoint's oldestMultiXid: 1
> | Latest checkpoint's oldestMulti's DB: 1
> | Maximum data alignment: 8
> ...
> | Values to be changed:
> |
> | First log segment after reset: 00000001000000000000000C
>
> But "pg_resetxlog -f" made the change as below,
>
> | *** /tmp/1.txt 2014-06-25 10:49:42.269336739 +0900
> | --- /tmp/2.txt 2014-06-25 10:49:49.780266229 +0900
> | ***************
> | *** 5,9 ****
> | ! pg_control last modified: Wed 25 Jun 2014 10:45:20 AM JST
> | ! Latest checkpoint location: 0/B8DE1A0
> | ! Prior checkpoint location: 0/B8DE138
> | ! Latest checkpoint's REDO location: 0/B8DE1A0
> | ! Latest checkpoint's REDO WAL file: 00000001000000000000000B
> | --- 5,9 ----
> | ! pg_control last modified: Wed 25 Jun 2014 10:49:46 AM JST
> | ! Latest checkpoint location: 0/C000028
> | ! Prior checkpoint location: 0/0
> | ! Latest checkpoint's REDO location: 0/C000028
> | ! Latest checkpoint's REDO WAL file: 00000001000000000000000C
> | ***************
> | *** 22 ****
> | ! Time of latest checkpoint: Wed 25 Jun 2014 10:45:20 AM JST
> | --- 22 ----
> | ! Time of latest checkpoint: Wed 25 Jun 2014 10:49:46 AM JST
>
> There are some changes which haven't been shown by '-n' option,
> even not displayed at all. I think these should be shown by
> '-n'. I suppose this is a kind of bug but fixing it seems to be a
> kind of 'feature change'..
>
> Any suggestions?

This seems the problem of the document and the help message of -n option.
According to the source code, -n option displays only the values that -e, -l,
-m -o, -O, and -x options change. The values -f option forcibly changes are
not be shown in -n option. I'm not sure if this is an oversight in 108e399...

Anyway, I think that making -n option display all the values that -f option
changes would be useful. But since that's not a bugfix, we should apply it
only in HEAD.

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Abhijit Menon-Sen 2014-06-25 03:56:53 Re: pgaudit - an auditing extension for PostgreSQL
Previous Message Robert Haas 2014-06-25 02:31:43 Re: PostgreSQL for VAX on NetBSD/OpenBSD