From: Noah Misch <noah@leadboat.com>
To: Aya Iwata (Fujitsu) <iwata.aya@fujitsu.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: 'WARNING: you don't own a lock of type ExclusiveLock' is printed during the GRANT command on PostgreSQL16.5
Date: Tue, 19 Nov 2024 22:27:42 -0800
Message-ID: <20241120062742.b0.nmisch@google.com> (raw)
In-Reply-To: <OS7PR01MB11964507B5548245A7EE54E70EA212@OS7PR01MB11964.jpnprd01.prod.outlook.com>
References: <OS7PR01MB11964507B5548245A7EE54E70EA212@OS7PR01MB11964.jpnprd01.prod.outlook.com>
On Wed, Nov 20, 2024 at 05:11:07AM +0000, Aya Iwata (Fujitsu) wrote:
> During our tests on November release,
> we discovered a "WARNING: you don't own a lock of type ExclusiveLock" that occurred at a strange time in GRANT command.
>
> [Details]
> Version:
> 16.5
> 1. Set binaries bin and lib path
> 2. Initiate the server using initdb command
> 3. create folder for tablespace
> 4. start the server usaing pg_ctl command
> 5. execute the following commands:
>
> This is only possible when psql executes each command individually.
> $ psql -d postgres -c "CREATE USER nmluser1;"
> CREATE ROLE
> $ psql -d postgres -c "CREATE TABLESPACE test_tblspace LOCATION '/xxx /xxx/pgsql16.5/tbs';"
> CREATE TABLESPACE
> $ psql -d postgres -c "CREATE DATABASE enc_testdb;"
> CREATE DATABASE
> $ psql -d postgres -c "GRANT ALL PRIVILEGES ON DATABASE postgres TO nmluser1;"
> GRANT
> $ psql -d postgres -c "GRANT ALL PRIVILEGES ON DATABASE enc_testdb TO nmluser1;"
> GRANT
> $ psql -d postgres -c "GRANT CREATE ON TABLESPACE test_tblspace TO nmluser1;"
> WARNING: you don't own a lock of type ExclusiveLock
> GRANT
>
>
> [Investigated]
> - This WARNING did not occur when tested with FEP16.4 using the same "Reproduction procedure:"
> - This WARNING did not occur when running CREATE ROLE through GRANT in a single session connected to psql.
> - Also, it did not happen when running 'psql -f' with an .sql file
> - We have run similar tests in the November releases of v12 through v17, but this is not reported by the tester in those releases.
> -- Therefore, we have not tried this "Reproduction procedure:" on versions other than 16.5 and 16.4.
> - This WARNING message appears in several places, and after modifying the source code to know which elog it is,
> seemed to come from ReleaseSysCache() in ExecGrant_common()
Thanks for the report. This seems reasonably likely to come from a defect in
commit 51ff46d. I will look into it.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noah@leadboat.com, iwata.aya@fujitsu.com, pgsql-bugs@lists.postgresql.org
Subject: Re: 'WARNING: you don't own a lock of type ExclusiveLock' is printed during the GRANT command on PostgreSQL16.5
In-Reply-To: <20241120062742.b0.nmisch@google.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox