pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Ensure correct lock level is used in ALTER ... RENAME
6+ messages / 2 participants
[nested] [flat]
Commits from this thread:
2021-10-20 cd124d205c 3c8c49945d a73a3671da 7182788552 Protect against collation variations in test
* pgsql: Ensure correct lock level is used in ALTER ... RENAME
@ 2021-10-19 22:11 Alvaro Herrera <alvherre@alvh.no-ip.org>
0 siblings, 0 replies; 6+ messages in thread
From: Alvaro Herrera @ 2021-10-19 22:11 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Ensure correct lock level is used in ALTER ... RENAME
Commit 1b5d797cd4f7 intended to relax the lock level used to rename
indexes, but inadvertently allowed *any* relation to be renamed with a
lowered lock level, as long as the command is spelled ALTER INDEX.
That's undesirable for other relation types, so retry the operation with
the higher lock if the relation turns out not to be an index.
After this fix, ALTER INDEX <sometable> RENAME will require access
exclusive lock, which it didn't before.
Author: Nathan Bossart <bossartn@amazon.com>
Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reported-by: Onder Kalaci <onderk@microsoft.com>
Discussion: https://postgr.es/m/PH0PR21MB1328189E2821CDEC646F8178D8AE9@PH0PR21MB1328.namprd21.prod.outlook.com
Branch
------
REL_12_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/6c8d1c197bd67e78c12c68d8f0bd111a59e7bccd
Modified Files
--------------
src/backend/commands/tablecmds.c | 62 ++++++++++++++++++++++++-------
src/test/regress/expected/alter_table.out | 48 ++++++++++++++++++++++++
src/test/regress/sql/alter_table.sql | 31 ++++++++++++++++
3 files changed, 127 insertions(+), 14 deletions(-)
^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Ensure correct lock level is used in ALTER ... RENAME
@ 2021-10-19 22:11 Alvaro Herrera <alvherre@alvh.no-ip.org>
0 siblings, 0 replies; 6+ messages in thread
From: Alvaro Herrera @ 2021-10-19 22:11 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Ensure correct lock level is used in ALTER ... RENAME
Commit 1b5d797cd4f7 intended to relax the lock level used to rename
indexes, but inadvertently allowed *any* relation to be renamed with a
lowered lock level, as long as the command is spelled ALTER INDEX.
That's undesirable for other relation types, so retry the operation with
the higher lock if the relation turns out not to be an index.
After this fix, ALTER INDEX <sometable> RENAME will require access
exclusive lock, which it didn't before.
Author: Nathan Bossart <bossartn@amazon.com>
Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reported-by: Onder Kalaci <onderk@microsoft.com>
Discussion: https://postgr.es/m/PH0PR21MB1328189E2821CDEC646F8178D8AE9@PH0PR21MB1328.namprd21.prod.outlook.com
Branch
------
REL_13_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/842fe6123c8acd09fac904ffb89bee883b36ac12
Modified Files
--------------
src/backend/commands/tablecmds.c | 62 ++++++++++++++++++++++++-------
src/test/regress/expected/alter_table.out | 48 ++++++++++++++++++++++++
src/test/regress/sql/alter_table.sql | 31 ++++++++++++++++
3 files changed, 127 insertions(+), 14 deletions(-)
^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Ensure correct lock level is used in ALTER ... RENAME
@ 2021-10-19 22:11 Alvaro Herrera <alvherre@alvh.no-ip.org>
0 siblings, 0 replies; 6+ messages in thread
From: Alvaro Herrera @ 2021-10-19 22:11 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Ensure correct lock level is used in ALTER ... RENAME
Commit 1b5d797cd4f7 intended to relax the lock level used to rename
indexes, but inadvertently allowed *any* relation to be renamed with a
lowered lock level, as long as the command is spelled ALTER INDEX.
That's undesirable for other relation types, so retry the operation with
the higher lock if the relation turns out not to be an index.
After this fix, ALTER INDEX <sometable> RENAME will require access
exclusive lock, which it didn't before.
Author: Nathan Bossart <bossartn@amazon.com>
Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reported-by: Onder Kalaci <onderk@microsoft.com>
Discussion: https://postgr.es/m/PH0PR21MB1328189E2821CDEC646F8178D8AE9@PH0PR21MB1328.namprd21.prod.outlook.com
Branch
------
REL_14_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/3ce3fb2f7dc66fef67c8184b96245d74372b729e
Modified Files
--------------
src/backend/commands/tablecmds.c | 62 ++++++++++++++++++++++++-------
src/test/regress/expected/alter_table.out | 48 ++++++++++++++++++++++++
src/test/regress/sql/alter_table.sql | 31 ++++++++++++++++
3 files changed, 127 insertions(+), 14 deletions(-)
^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Ensure correct lock level is used in ALTER ... RENAME
@ 2021-10-19 22:11 Alvaro Herrera <alvherre@alvh.no-ip.org>
0 siblings, 1 reply; 6+ messages in thread
From: Alvaro Herrera @ 2021-10-19 22:11 UTC (permalink / raw)
To: pgsql-committers@lists.postgresql.org
Ensure correct lock level is used in ALTER ... RENAME
Commit 1b5d797cd4f7 intended to relax the lock level used to rename
indexes, but inadvertently allowed *any* relation to be renamed with a
lowered lock level, as long as the command is spelled ALTER INDEX.
That's undesirable for other relation types, so retry the operation with
the higher lock if the relation turns out not to be an index.
After this fix, ALTER INDEX <sometable> RENAME will require access
exclusive lock, which it didn't before.
Author: Nathan Bossart <bossartn@amazon.com>
Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reported-by: Onder Kalaci <onderk@microsoft.com>
Discussion: https://postgr.es/m/PH0PR21MB1328189E2821CDEC646F8178D8AE9@PH0PR21MB1328.namprd21.prod.outlook.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/c2c618ff1137f9ef58827f57e4ec0f97453e454e
Modified Files
--------------
src/backend/commands/tablecmds.c | 62 ++++++++++++++++++++++++-------
src/test/regress/expected/alter_table.out | 48 ++++++++++++++++++++++++
src/test/regress/sql/alter_table.sql | 31 ++++++++++++++++
3 files changed, 127 insertions(+), 14 deletions(-)
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pgsql: Ensure correct lock level is used in ALTER ... RENAME
@ 2021-10-20 07:59 Michael Paquier <michael@paquier.xyz>
parent: Alvaro Herrera <alvherre@alvh.no-ip.org>
0 siblings, 1 reply; 6+ messages in thread
From: Michael Paquier @ 2021-10-20 07:59 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: pgsql-committers@lists.postgresql.org
Hi Alvaro,
On Tue, Oct 19, 2021 at 10:11:24PM +0000, Alvaro Herrera wrote:
> Ensure correct lock level is used in ALTER ... RENAME
>
> Commit 1b5d797cd4f7 intended to relax the lock level used to rename
> indexes, but inadvertently allowed *any* relation to be renamed with a
> lowered lock level, as long as the command is spelled ALTER INDEX.
> That's undesirable for other relation types, so retry the operation with
> the higher lock if the relation turns out not to be an index.
>
> After this fix, ALTER INDEX <sometable> RENAME will require access
> exclusive lock, which it didn't before.
hippopotamus and jay are complaining that this commit has introduced a
test with ordering issues:
ORDER BY relation::regclass::text;
relation | mode
--------------------------------+---------------------
- alter_idx_rename_test_2 | AccessExclusiveLock
alter_idx_rename_test_parted_2 | AccessExclusiveLock
+ alter_idx_rename_test_2 | AccessExclusiveLock
(2 rows)
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=hippopotamus&dt=2021-10-19%2023%3A43%3A1...
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pgsql: Ensure correct lock level is used in ALTER ... RENAME
@ 2021-10-20 10:02 Alvaro Herrera <alvherre@alvh.no-ip.org>
parent: Michael Paquier <michael@paquier.xyz>
0 siblings, 0 replies; 6+ messages in thread
From: Alvaro Herrera @ 2021-10-20 10:02 UTC (permalink / raw)
To: Michael Paquier <michael@paquier.xyz>; +Cc: pgsql-committers@lists.postgresql.org
Hi,
On 2021-Oct-20, Michael Paquier wrote:
> hippopotamus and jay are complaining that this commit has introduced a
> test with ordering issues:
> ORDER BY relation::regclass::text;
Oh, I forgot that we need a COLLATE clause there. Will fix, thanks ...
--
Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/
"No hay ausente sin culpa ni presente sin disculpa" (Prov. francés)
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2021-10-20 10:02 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-10-19 22:11 pgsql: Ensure correct lock level is used in ALTER ... RENAME Alvaro Herrera <alvherre@alvh.no-ip.org>
2021-10-20 07:59 ` Michael Paquier <michael@paquier.xyz>
2021-10-20 10:02 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
2021-10-19 22:11 pgsql: Ensure correct lock level is used in ALTER ... RENAME Alvaro Herrera <alvherre@alvh.no-ip.org>
2021-10-19 22:11 pgsql: Ensure correct lock level is used in ALTER ... RENAME Alvaro Herrera <alvherre@alvh.no-ip.org>
2021-10-19 22:11 pgsql: Ensure correct lock level is used in ALTER ... RENAME Alvaro Herrera <alvherre@alvh.no-ip.org>
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