Re: [v15 beta] pg_upgrade failed if earlier executed with -c switch - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: [v15 beta] pg_upgrade failed if earlier executed with -c switch
Date
Msg-id 20220604141346.GQ29853@telsasoft.com
Whole thread Raw
In response to Re: [v15 beta] pg_upgrade failed if earlier executed with -c switch  (Michael Paquier <michael@paquier.xyz>)
Responses Re: [v15 beta] pg_upgrade failed if earlier executed with -c switch
List pgsql-hackers
On Sat, Jun 04, 2022 at 06:48:19PM +0900, Michael Paquier wrote:
> I would suggest the attached patch then, to add a --check command in
> the test suite, with a change to clean up the logs when --check is
> used without --retain.

This doesn't address one of the problems that I already enumerated.

./tmp_install/usr/local/pgsql/bin/initdb -D pgsql15.dat
./tmp_install/usr/local/pgsql/bin/initdb -D pgsql15.dat-2

$ ./tmp_install/usr/local/pgsql/bin/pg_upgrade -b ./tmp_install/usr/local/pgsql/bin/bad -d pgsql15.dat-2 -D
pgsql15.dat-2
 
check for "tmp_install/usr/local/pgsql/bin/bad" failed: No such file or directory
Failure, exiting

$ ./tmp_install/usr/local/pgsql/bin/pg_upgrade -b ./tmp_install/usr/local/pgsql/bin/bad -d pgsql15.dat-2 -D
pgsql15.dat-2
 
could not create directory "pgsql15.dat-2/pg_upgrade_output.d": File exists
Failure, exiting

..failing the 2nd time because it failed the 1st time (even if I fix the bad
argument).

Maybe that's easy enough to fix just be rearranging verify_directories() or
make_outputdirs().

But actually it seems annoying to have to remove the failed outputdir.
It's true that those logs *can* be useful to fix whatever underlying problem,
but I'm afraid the *requirement* to remove the failed outputdir is a nuisance,
even outside of check mode.

-- 
Justin



pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: pg_rewind: warn when checkpoint hasn't happened after promotion
Next
From: Tom Lane
Date:
Subject: Re: Count output lines automatically in psql/help.c