Re: pg_upgrade --clone error checking - Mailing list pgsql-hackers

From Jeff Janes
Subject Re: pg_upgrade --clone error checking
Date
Msg-id CAMkU=1xrwk1zbMcwRt1VQNbTagRnOnp0jhqeOMTf5RsFdbXuDA@mail.gmail.com
Whole thread Raw
In response to Re: pg_upgrade --clone error checking  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: pg_upgrade --clone error checking  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On Thu, May 2, 2019 at 11:57 AM Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote:
On 2019-05-01 22:10, Jeff Janes wrote:
> With the new pg_upgrade --clone, if we are going to end up throwing the
> error "file cloning not supported on this platform" (which seems to
> depend only on ifdefs) I think we should throw it first thing, before
> any other checks are done and certainly before pg_dump gets run.

Could you explain in more detail what command you are running, what
messages you are getting, and what you would like to see instead?

I'm running:

pg_upgrade --clone -b /home/jjanes/pgsql/REL9_6_12/bin/ -B /home/jjanes/pgsql/origin_jit/bin/ -d /home/jjanes/pgsql/data_96/ -D /home/jjanes/pgsql/data_clone/

And I get:

Performing Consistency Checks
-----------------------------
Checking cluster versions                                   ok
Checking database user is the install user                  ok
Checking database connection settings                       ok
Checking for prepared transactions                          ok
Checking for reg* data types in user tables                 ok
Checking for contrib/isn with bigint-passing mismatch       ok
Checking for tables WITH OIDS                               ok
Checking for invalid "unknown" user columns                 ok
Creating dump of global objects                             ok
Creating dump of database schemas
                                                            ok
Checking for presence of required libraries                 ok

file cloning not supported on this platform
Failure, exiting

I think the error message wording is OK, I think it should be thrown earlier, before the "Creating dump of database schemas" (which can take a long time), and preferably before either database is even started.  So ideally it would be something like:


Performing Consistency Checks
-----------------------------
Checking cluster versions
Checking file cloning support                                   
File cloning not supported on this platform
Failure, exiting


When something is doomed to fail, we should report the failure as early as feasibly detectable.

Cheers,

Jeff

pgsql-hackers by date:

Previous
From: Antonin Houska
Date:
Subject: Re: Attempt to consolidate reading of XLOG page
Next
From: Alvaro Herrera
Date:
Subject: Re: pg_upgrade --clone error checking