Re: [HACKERS] renaming pg_resetxlog to pg_resetwal has broken pg_upgrade. - Mailing list pgsql-hackers

From Jeff Janes
Subject Re: [HACKERS] renaming pg_resetxlog to pg_resetwal has broken pg_upgrade.
Date
Msg-id CAMkU=1w5rNZ9z2=C=zD=qPG+eJ9W6fL2NeX9xrWmM2OtLsFdCg@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] renaming pg_resetxlog to pg_resetwal has broken pg_upgrade.  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [HACKERS] renaming pg_resetxlog to pg_resetwal has broken pg_upgrade.  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On Mon, Feb 13, 2017 at 6:19 PM, Michael Paquier <michael.paquier@gmail.com> wrote:
On Tue, Feb 14, 2017 at 9:09 AM, Jeff Janes <jeff.janes@gmail.com> wrote:
> check for "/usr/local/pgsql9_6/bin/pg_resetwal" failed: No such file or
> directory
>
> This looks somewhat complicated to fix.  Should check_bin_dir test the old
> cluster version, and make a deterministic check based on that?  Or just
> check for either spelling, and stash the successful result somewhere?

The fix does not seem that complicated to me. get_bin_version() just
needs pg_ctl to be present, so we could move that in check_bin_dir()
after looking if pg_ctl is in a valid state, and reuse the version of
bin_version to see if the binary version is post-10 or not. Then the
decision making just depends on this value. Please see the patch
attached, this is passing 9.6->10 and check-world.

That fixes it for me.  

I thought people would object to checking the version number in two different places to make the same fundamental decision, and would want that refactored somehow.  But if you are OK with it, then I am.

Cheers,

Jeff

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] gitlab post-mortem: pg_basebackup waiting for checkpoint
Next
From: Tomas Vondra
Date:
Subject: Re: [HACKERS] PATCH: two slab-like memory allocators