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: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, 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 17:05:14
Message-ID: CAB7nPqSspotYG-TF1t07Qyuf625o_Dpfy5JXvvCGGam_vPxO5Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 29, 2017 at 10:02 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
>> On Mon, May 29, 2017 at 9:00 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> So we need to prevent this, not try to make it work. I don't think
>>> we can insist on a version match in pg_control, because part of the
>>> point of pg_resetxlog/pg_resetwal is to recover if pg_control is
>>> unreadable. But I think we could look at PG_VERSION, which is only a
>>> text file.
>
>> Agreed. Shouldn't this be back-patched? PG_CONTROL_VERSION has not
>> been bumped between 9.4 and 9.5. Attached is a patch for HEAD.
>
> Yeah, I'm thinking it would be a good idea to enforce this in all
> branches. Your patch looks sane in a quick once-over, but I didn't
> test it.

Thanks. I can provide patches for back-branches as needed.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christoph Berg 2017-05-29 17:21:07 Re: Surjective functional indexes
Previous Message Tom Lane 2017-05-29 17:02:28 Re: pg_resetwal is broken if run from v10 against older version of PG data directory