Re: pg_resetwal is broken if run from v10 against older version of PG data directory

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_resetwal is broken if run from v10 against older version of PG data directory
Date: 2017-05-29 15:45:41
Message-ID: CAB7nPqTVMn=G4nKG0p7TJdt4Y3TqjXQ7w20oiQCNqT7pXFR0Fw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 29, 2017 at 3:19 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> I think this happens due to commit
> f82ec32ac30ae7e3ec7c84067192535b2ff8ec0e which renames pg_xlog to
> pg_wal. It does take care of making some of the modules like
> pg_basebackup to understand both old and new directory structures, but
> not done for all the modules. I think we should make similar changes
> in pg_resetwal or at the very least update the docs to indicate
> pg_resetwal can give an error if used against pre-10 data directory.

Contrary to pg_basebackup which makes clear in its documentation that
it is compatible with past server versions down to 9.1, pg_resetwal
does not mention such guarantees. And actually, it seems to me that it
is rather unsafe to use it across major versions as the size of
ControlFileData varies across major versions so you can write junk
bytes in the control file by using pg_resetwal from v10 on a 9.6
server.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christoph Berg 2017-05-29 15:58:50 Re: [PATCH] relocation truncated to fit: citus build failure on s390x
Previous Message Tom Lane 2017-05-29 15:45:37 Re: pg_resetwal is broken if run from v10 against older version of PG data directory