Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iFRxK-000117-Bn for pgsql-committers@arkaria.postgresql.org; Tue, 01 Oct 2019 23:53:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iFRxI-0005Yb-8v for pgsql-committers@arkaria.postgresql.org; Tue, 01 Oct 2019 23:53:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iFRxG-0005YH-KE for pgsql-committers@lists.postgresql.org; Tue, 01 Oct 2019 23:53:20 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iFRxB-0003vd-Cc for pgsql-committers@lists.postgresql.org; Tue, 01 Oct 2019 23:53:18 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4502D2134B; Tue, 1 Oct 2019 19:53:10 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 01 Oct 2019 19:53:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=lPU3IQAAH+axkKziUkZFREOulB7 wC1j8unRwRShAA+E=; b=MssC75JzUAVW4o2/jlurHKvge2kDi2y/bIvC6fc5bMu AUbIRtCta6c4Y7e38CEzLA3GvWJOnXyEgqb5gEFDfmHnk1FZexh9hcIGukydpXqM U7AB8Biya1X5HeYnmun/DqBquLxSGgaoIRMcqGnkz+fjcfHQ0w31J29bMg0uiCgt Njy+i0yQNggk1D/rHbHe2jhPTsN9DfZkUgG3R2y+VhLDZX4jiUvzzMjcvKGgiFR4 H4LhBSGBhdmJjqVTG7Q9aJcXoJNBLCwdFFmRokwAmmlM5+g71r7of0Dkid0aeKri 9ZknfFKv+28gA7NhBa/1FjjtfRMg7lItKziQeTLyV7w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=lPU3IQ AAH+axkKziUkZFREOulB7wC1j8unRwRShAA+E=; b=vhHfxEwll+UTyDOOD4YMXz RL1Y5sl8PMa+sPo8rmkZcXLXKa8BUeTyXsL8OHDSON339Z2Bjd/T8pAqaS0S9BpA l5fLIYVdE2TK1KLx1h2aBapdjg+gif7Iw38pfinlC/wwSmc6Dd5pnoQI2m1GduqD u6KeW77f/Um0JOhEKcJi7KlotFoEMcl9aykU9wsBccMVAwwDe/cQdsq+92qO273l Y7jkd7AsPSx8+6Ri2xs0WHYbI+W46MHCVZSo3dAJblmYxxVdlNbwD0BGFobeIx44 fbu/Nq3tq7AW74lDgc9BGAk5as4eEBwa3vbnJE7ie6kUbs0tR5K7xLAmoM0s393A == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrgeehgddvjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddu necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecukfhppeduuddurddutddvrddukedtrddukeehnecurfgrrhgr mhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiinecuvehluh hsthgvrhfuihiivgeptd X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id E0703D6005A; Tue, 1 Oct 2019 19:53:08 -0400 (EDT) Date: Wed, 2 Oct 2019 08:53:06 +0900 From: Michael Paquier To: Andrew Dunstan Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Add hooks for session start and session end, take two Message-ID: <20191001235306.GA3130@paquier.xyz> References: <20191001045246.GF2781@paquier.xyz> <20191001052245.GH2781@paquier.xyz> <20191001071320.GJ2781@paquier.xyz> <20191001142816.GA25272@paquier.xyz> <97f71fee-4068-c0be-342d-146cfac70bbb@2ndQuadrant.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GID0FwUMdk1T2AWN" Content-Disposition: inline In-Reply-To: <97f71fee-4068-c0be-342d-146cfac70bbb@2ndQuadrant.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --GID0FwUMdk1T2AWN Content-Type: multipart/mixed; boundary="xHFwDpU9dbj6ez1V" Content-Disposition: inline --xHFwDpU9dbj6ez1V Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 01, 2019 at 03:24:21PM -0400, Andrew Dunstan wrote: > I'll fix up the logging. Meanwhile, the log is showing: >=20 > \c :prevdb regress_sess_hook_usr1 > \connect: FATAL:=A0 SSPI authentication failed for user > "regress_sess_hook_usr1" >=20 > That's not surprising given the hba and ident file contents. Thanks for the details of the logs! That makes sense, and we actually do not have other modules with NO_INSTALLCHECK which use \c to reconnect in a test. The attached patch should be able to fix the issue. Could you confirm? -- Michael --xHFwDpU9dbj6ez1V Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="session-hook-test-fix.patch" Content-Transfer-Encoding: quoted-printable diff --git a/src/test/modules/test_session_hooks/Makefile b/src/test/module= s/test_session_hooks/Makefile index e8ba6990f6..f6ecf76ce5 100644 --- a/src/test/modules/test_session_hooks/Makefile +++ b/src/test/modules/test_session_hooks/Makefile @@ -5,7 +5,7 @@ OBJS =3D test_session_hooks.o $(WIN32RES) PGFILEDESC =3D "test_session_hooks - tests for start and end session hooks" =20 REGRESS =3D test_session_hooks -REGRESS_OPTS =3D --temp-config=3D$(top_srcdir)/src/test/modules/test_sessi= on_hooks/session_hooks.conf +REGRESS_OPTS =3D --create-role=3Dregress_sess_hook_usr1,regress_sess_hook_= usr2 --temp-config=3D$(top_srcdir)/src/test/modules/test_session_hooks/sess= ion_hooks.conf # Disabled because these tests require extra configuration with # "shared_preload_libraries=3Dtest_session_hooks", which typical # installcheck users do not have (e.g. buildfarm clients). diff --git a/src/test/modules/test_session_hooks/expected/test_session_hook= s.out b/src/test/modules/test_session_hooks/expected/test_session_hooks.out index 120dcc9a11..a5a93a8c39 100644 --- a/src/test/modules/test_session_hooks/expected/test_session_hooks.out +++ b/src/test/modules/test_session_hooks/expected/test_session_hooks.out @@ -2,8 +2,8 @@ -- Tests for start and end session hooks -- -- Only activity from role regress_sess_hook_usr2 is logged. -CREATE ROLE regress_sess_hook_usr1 SUPERUSER LOGIN; -CREATE ROLE regress_sess_hook_usr2 SUPERUSER LOGIN; +ALTER ROLE regress_sess_hook_usr1 SUPERUSER LOGIN; +ALTER ROLE regress_sess_hook_usr2 SUPERUSER LOGIN; \set prevdb :DBNAME \set prevusr :USER CREATE TABLE session_hook_log(id SERIAL, dbname TEXT, username TEXT, hook_= at TEXT); @@ -33,5 +33,3 @@ SELECT * FROM session_hook_log ORDER BY id; 2 | contrib_regression | regress_sess_hook_usr2 | END (2 rows) =20 -DROP ROLE regress_sess_hook_usr1; -DROP ROLE regress_sess_hook_usr2; diff --git a/src/test/modules/test_session_hooks/sql/test_session_hooks.sql= b/src/test/modules/test_session_hooks/sql/test_session_hooks.sql index 1cc06f613b..f041c8bed8 100644 --- a/src/test/modules/test_session_hooks/sql/test_session_hooks.sql +++ b/src/test/modules/test_session_hooks/sql/test_session_hooks.sql @@ -3,8 +3,8 @@ -- =20 -- Only activity from role regress_sess_hook_usr2 is logged. -CREATE ROLE regress_sess_hook_usr1 SUPERUSER LOGIN; -CREATE ROLE regress_sess_hook_usr2 SUPERUSER LOGIN; +ALTER ROLE regress_sess_hook_usr1 SUPERUSER LOGIN; +ALTER ROLE regress_sess_hook_usr2 SUPERUSER LOGIN; \set prevdb :DBNAME \set prevusr :USER CREATE TABLE session_hook_log(id SERIAL, dbname TEXT, username TEXT, hook_= at TEXT); @@ -15,5 +15,3 @@ SELECT * FROM session_hook_log ORDER BY id; SELECT * FROM session_hook_log ORDER BY id; \c :prevdb :prevusr SELECT * FROM session_hook_log ORDER BY id; -DROP ROLE regress_sess_hook_usr1; -DROP ROLE regress_sess_hook_usr2; --xHFwDpU9dbj6ez1V-- --GID0FwUMdk1T2AWN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl2T5uIACgkQnvQgOdby QH25ug//dWCUFoHx4v6f7UXLSj5i+mARtldGRUUG6U6z6hpdhtZFbdhfc6Mp5/R1 56pN0Pt9z7H+aTIe16q6YKaitc7eAF7tEPHKBuiwTRWWjv99J0PIXrrfSMChm7op 3HqPrLnWdkIQwt5jpTrQfDIgcUeKqFOf8E3+FWMw7WUd2ALekiAiVP2RhrDApI+S X5iyKkcTKgyY0guihT8Uul7BI7XlsdJV5KmQi5DWh2HVRj862Rj0giE6z4w0wmTS TwrokU2V0YO8rVkjxpQqYX+AF4VDixo2DIXaCuFpYX9QgJBcjX3CTBl1XCqqYcSB jy+HBlgpg0OUj7xKi6knhsE3OxOykvHnJZgRhIadnBlTvl11QiRIORQz9OATI3J1 nZrjuJf9+0ujduIt+wVbsX+ld/Xw8f25tBvdF6nh+WeCUljOprRHE16TzwyzhQDy MHdClzcZruGJEzdjnkP8AjIsq36GcBr532TbKk4j/oB2CLjFjCtH3pvRM4I25m37 iPJvlaS4HTrn8F4MZkvUpgHFGdDKR2tmbY5EOXoESmP3URkGwobOmcSmEsKrU60j 3WuCrSHV0f5IBKaMvh5W7ZkiX3k7kVjBOtgaob6dhgIF9GXfOE/v3/f6x+GRoeBz TW77sx0cs8kZCd83NVTJMJ7EVUBG3jNOIBQ5bbJrpDJLpjiPBVk= =t7k0 -----END PGP SIGNATURE----- --GID0FwUMdk1T2AWN--