Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres - Mailing list pgsql-hackers

From Christoph Berg
Subject Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres
Date
Msg-id YFnWBYinNf1s0Y6v@msg.df7cb.de
Whole thread Raw
Responses Re: pgsql: Move tablespace path re-creation from the makefiles to pg_regres  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Re: Michael Paquier
> Move tablespace path re-creation from the makefiles to pg_regress
> 
> Moving this logic into pg_regress fixes a potential failure with
> parallel tests when pg_upgrade and the main regression test suite both
> trigger the makefile rule that cleaned up testtablespace/ under
> src/test/regress.  Even if pg_upgrade was triggering this rule, it has
> no need to do so as it uses a different tablespace path.  So if
> pg_upgrade triggered the makefile rule for the tablespace setup while
> the main regression test suite ran the tablespace cases, it would fail.
> 
> 61be85a was a similar attempt at achieving that, but that broke cases
> where the regression tests require to run under an Administrator
> account, like with Appveyor.

This change broke running the testsuite on an existing PG server, if
server user and pg_regress client user are different. This is one of
the tests exercised by Debian's autopkgtest suite.

Previously I could create the tablespace directory, chown it to
postgres, and fire up pg_regress with the correct options. Now
pg_regress wipes that directory, recreates it, and then the server
can't use it because user "postgres" can't write to it.

I'm working around the problem now by running the tests as user
"postgres", but does completely break in environments where users want
to run the testsuite from a separate compilation user but don't have root.

Old code:
https://salsa.debian.org/postgresql/postgresql/-/blob/8b1217fcae3e64155bc35517acbd50c6f166d997/debian/tests/installcheck
Workaround:
https://salsa.debian.org/postgresql/postgresql/-/blob/cbc0240bec738b6ab3b61c498825b82c8ff21a70/debian/tests/installcheck

Christoph



pgsql-hackers by date:

Previous
From: "Drouvot, Bertrand"
Date:
Subject: Re: Minimal logical decoding on standbys
Next
From: Jan Wieck
Date:
Subject: Re: pg_upgrade failing for 200+ million Large Objects