pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: In REASSIGN OWNED of a database, lock the tuple as mandated.
6+ messages / 1 participants
[nested] [flat]

* pgsql: In REASSIGN OWNED of a database, lock the tuple as mandated.
@ 2024-12-28 15:21 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2024-12-28 15:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In REASSIGN OWNED of a database, lock the tuple as mandated.

Commit aac2c9b4fde889d13f859c233c2523345e72d32b mandated such locking
and attempted to fulfill that mandate, but it missed REASSIGN OWNED.
Hence, it remained possible to lose VACUUM's inplace update of
datfrozenxid if a REASSIGN OWNED processed that database at the same
time.  This didn't affect the other inplace-updated catalog, pg_class.
For pg_class, REASSIGN OWNED calls ATExecChangeOwner() instead of the
generic AlterObjectOwner_internal(), and ATExecChangeOwner() fulfills
the locking mandate.

Like in GRANT, implement this by following the locking protocol for any
catalog subject to the generic AlterObjectOwner_internal().  It would
suffice to do this for IsInplaceUpdateOid() catalogs only.  Back-patch
to v13 (all supported versions).

Kirill Reshke.  Reported by Alexander Kukushkin.

Discussion: https://postgr.es/m/CAFh8B=mpKjAy4Cuun-HP-f_vRzh2HSvYFG3rhVfYbfEBUhBAGg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ff90ee61450921e03fe3af4e0f75337a4bbd0584

Modified Files
--------------
src/backend/catalog/objectaddress.c    | 27 ++++++++++++++++++++++++++-
src/backend/commands/alter.c           |  9 ++++++++-
src/include/catalog/objectaddress.h    |  4 ++++
src/test/regress/expected/database.out |  6 ++++++
src/test/regress/sql/database.sql      |  7 +++++++
5 files changed, 51 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: In REASSIGN OWNED of a database, lock the tuple as mandated.
@ 2024-12-28 15:21 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2024-12-28 15:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In REASSIGN OWNED of a database, lock the tuple as mandated.

Commit aac2c9b4fde889d13f859c233c2523345e72d32b mandated such locking
and attempted to fulfill that mandate, but it missed REASSIGN OWNED.
Hence, it remained possible to lose VACUUM's inplace update of
datfrozenxid if a REASSIGN OWNED processed that database at the same
time.  This didn't affect the other inplace-updated catalog, pg_class.
For pg_class, REASSIGN OWNED calls ATExecChangeOwner() instead of the
generic AlterObjectOwner_internal(), and ATExecChangeOwner() fulfills
the locking mandate.

Like in GRANT, implement this by following the locking protocol for any
catalog subject to the generic AlterObjectOwner_internal().  It would
suffice to do this for IsInplaceUpdateOid() catalogs only.  Back-patch
to v13 (all supported versions).

Kirill Reshke.  Reported by Alexander Kukushkin.

Discussion: https://postgr.es/m/CAFh8B=mpKjAy4Cuun-HP-f_vRzh2HSvYFG3rhVfYbfEBUhBAGg@mail.gmail.com

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fa6131377054d04f7c938b196b39eeb22784951b

Modified Files
--------------
src/backend/catalog/objectaddress.c    | 27 ++++++++++++++++++++++++++-
src/backend/commands/alter.c           |  9 ++++++++-
src/include/catalog/objectaddress.h    |  4 ++++
src/test/regress/expected/database.out |  6 ++++++
src/test/regress/sql/database.sql      |  7 +++++++
5 files changed, 51 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: In REASSIGN OWNED of a database, lock the tuple as mandated.
@ 2024-12-28 15:21 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2024-12-28 15:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In REASSIGN OWNED of a database, lock the tuple as mandated.

Commit aac2c9b4fde889d13f859c233c2523345e72d32b mandated such locking
and attempted to fulfill that mandate, but it missed REASSIGN OWNED.
Hence, it remained possible to lose VACUUM's inplace update of
datfrozenxid if a REASSIGN OWNED processed that database at the same
time.  This didn't affect the other inplace-updated catalog, pg_class.
For pg_class, REASSIGN OWNED calls ATExecChangeOwner() instead of the
generic AlterObjectOwner_internal(), and ATExecChangeOwner() fulfills
the locking mandate.

Like in GRANT, implement this by following the locking protocol for any
catalog subject to the generic AlterObjectOwner_internal().  It would
suffice to do this for IsInplaceUpdateOid() catalogs only.  Back-patch
to v13 (all supported versions).

Kirill Reshke.  Reported by Alexander Kukushkin.

Discussion: https://postgr.es/m/CAFh8B=mpKjAy4Cuun-HP-f_vRzh2HSvYFG3rhVfYbfEBUhBAGg@mail.gmail.com

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5d94aa4dc3a492830e0ac8f0292e26f5c6bd2b5b

Modified Files
--------------
src/backend/catalog/objectaddress.c    | 27 ++++++++++++++++++++++++++-
src/backend/commands/alter.c           |  9 ++++++++-
src/include/catalog/objectaddress.h    |  4 ++++
src/test/regress/expected/database.out |  6 ++++++
src/test/regress/sql/database.sql      |  7 +++++++
5 files changed, 51 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: In REASSIGN OWNED of a database, lock the tuple as mandated.
@ 2024-12-28 15:21 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2024-12-28 15:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In REASSIGN OWNED of a database, lock the tuple as mandated.

Commit aac2c9b4fde889d13f859c233c2523345e72d32b mandated such locking
and attempted to fulfill that mandate, but it missed REASSIGN OWNED.
Hence, it remained possible to lose VACUUM's inplace update of
datfrozenxid if a REASSIGN OWNED processed that database at the same
time.  This didn't affect the other inplace-updated catalog, pg_class.
For pg_class, REASSIGN OWNED calls ATExecChangeOwner() instead of the
generic AlterObjectOwner_internal(), and ATExecChangeOwner() fulfills
the locking mandate.

Like in GRANT, implement this by following the locking protocol for any
catalog subject to the generic AlterObjectOwner_internal().  It would
suffice to do this for IsInplaceUpdateOid() catalogs only.  Back-patch
to v13 (all supported versions).

Kirill Reshke.  Reported by Alexander Kukushkin.

Discussion: https://postgr.es/m/CAFh8B=mpKjAy4Cuun-HP-f_vRzh2HSvYFG3rhVfYbfEBUhBAGg@mail.gmail.com

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/83bb52375630ce93660bde938ffba93c6dc7fc63

Modified Files
--------------
src/backend/catalog/objectaddress.c    | 27 ++++++++++++++++++++++++++-
src/backend/commands/alter.c           |  9 ++++++++-
src/include/catalog/objectaddress.h    |  4 ++++
src/test/regress/expected/database.out |  6 ++++++
src/test/regress/sql/database.sql      |  7 +++++++
5 files changed, 51 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: In REASSIGN OWNED of a database, lock the tuple as mandated.
@ 2024-12-28 15:21 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2024-12-28 15:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In REASSIGN OWNED of a database, lock the tuple as mandated.

Commit aac2c9b4fde889d13f859c233c2523345e72d32b mandated such locking
and attempted to fulfill that mandate, but it missed REASSIGN OWNED.
Hence, it remained possible to lose VACUUM's inplace update of
datfrozenxid if a REASSIGN OWNED processed that database at the same
time.  This didn't affect the other inplace-updated catalog, pg_class.
For pg_class, REASSIGN OWNED calls ATExecChangeOwner() instead of the
generic AlterObjectOwner_internal(), and ATExecChangeOwner() fulfills
the locking mandate.

Like in GRANT, implement this by following the locking protocol for any
catalog subject to the generic AlterObjectOwner_internal().  It would
suffice to do this for IsInplaceUpdateOid() catalogs only.  Back-patch
to v13 (all supported versions).

Kirill Reshke.  Reported by Alexander Kukushkin.

Discussion: https://postgr.es/m/CAFh8B=mpKjAy4Cuun-HP-f_vRzh2HSvYFG3rhVfYbfEBUhBAGg@mail.gmail.com

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/536acda0bc7900c407c76c6ca6293e0ac2041f8b

Modified Files
--------------
src/backend/catalog/objectaddress.c    | 27 ++++++++++++++++++++++++++-
src/backend/commands/alter.c           |  9 ++++++++-
src/include/catalog/objectaddress.h    |  4 ++++
src/test/regress/expected/database.out |  6 ++++++
src/test/regress/sql/database.sql      |  7 +++++++
5 files changed, 51 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: In REASSIGN OWNED of a database, lock the tuple as mandated.
@ 2024-12-28 15:21 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Noah Misch @ 2024-12-28 15:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

In REASSIGN OWNED of a database, lock the tuple as mandated.

Commit aac2c9b4fde889d13f859c233c2523345e72d32b mandated such locking
and attempted to fulfill that mandate, but it missed REASSIGN OWNED.
Hence, it remained possible to lose VACUUM's inplace update of
datfrozenxid if a REASSIGN OWNED processed that database at the same
time.  This didn't affect the other inplace-updated catalog, pg_class.
For pg_class, REASSIGN OWNED calls ATExecChangeOwner() instead of the
generic AlterObjectOwner_internal(), and ATExecChangeOwner() fulfills
the locking mandate.

Like in GRANT, implement this by following the locking protocol for any
catalog subject to the generic AlterObjectOwner_internal().  It would
suffice to do this for IsInplaceUpdateOid() catalogs only.  Back-patch
to v13 (all supported versions).

Kirill Reshke.  Reported by Alexander Kukushkin.

Discussion: https://postgr.es/m/CAFh8B=mpKjAy4Cuun-HP-f_vRzh2HSvYFG3rhVfYbfEBUhBAGg@mail.gmail.com

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1025463225b806b9a00ce3289df37761a6c51c30

Modified Files
--------------
src/backend/catalog/objectaddress.c    | 27 ++++++++++++++++++++++++++-
src/backend/commands/alter.c           |  9 ++++++++-
src/include/catalog/objectaddress.h    |  4 ++++
src/test/regress/expected/database.out |  6 ++++++
src/test/regress/sql/database.sql      |  7 +++++++
5 files changed, 51 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2024-12-28 15:21 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-12-28 15:21 pgsql: In REASSIGN OWNED of a database, lock the tuple as mandated. Noah Misch <noah@leadboat.com>
2024-12-28 15:21 pgsql: In REASSIGN OWNED of a database, lock the tuple as mandated. Noah Misch <noah@leadboat.com>
2024-12-28 15:21 pgsql: In REASSIGN OWNED of a database, lock the tuple as mandated. Noah Misch <noah@leadboat.com>
2024-12-28 15:21 pgsql: In REASSIGN OWNED of a database, lock the tuple as mandated. Noah Misch <noah@leadboat.com>
2024-12-28 15:21 pgsql: In REASSIGN OWNED of a database, lock the tuple as mandated. Noah Misch <noah@leadboat.com>
2024-12-28 15:21 pgsql: In REASSIGN OWNED of a database, lock the tuple as mandated. Noah Misch <noah@leadboat.com>

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