pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Lock the extension during ALTER EXTENSION ADD/DROP. 7+ messages / 1 participants [nested] [flat]
* pgsql: Lock the extension during ALTER EXTENSION ADD/DROP. @ 2021-07-11 16:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2021-07-11 16:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Lock the extension during ALTER EXTENSION ADD/DROP. Although we were careful to lock the object being added or dropped, we failed to get any sort of lock on the extension itself. This allowed the ALTER to proceed in parallel with a DROP EXTENSION, which is problematic for a couple of reasons. If both commands succeeded we'd be left with a dangling link in pg_depend, which would cause problems later. Also, if the ALTER failed for some reason, it might try to print the extension's name, and that could result in a crash or (in older branches) a silly error message complaining about extension "(null)". Per bug #17098 from Alexander Lakhin. Back-patch to all supported branches. Discussion: https://postgr.es/m/17098-b960f3616c861f83@postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/626731db26ae2617e41536678440c3817128a006 Modified Files -------------- src/backend/commands/extension.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Lock the extension during ALTER EXTENSION ADD/DROP. @ 2021-07-11 16:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2021-07-11 16:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Lock the extension during ALTER EXTENSION ADD/DROP. Although we were careful to lock the object being added or dropped, we failed to get any sort of lock on the extension itself. This allowed the ALTER to proceed in parallel with a DROP EXTENSION, which is problematic for a couple of reasons. If both commands succeeded we'd be left with a dangling link in pg_depend, which would cause problems later. Also, if the ALTER failed for some reason, it might try to print the extension's name, and that could result in a crash or (in older branches) a silly error message complaining about extension "(null)". Per bug #17098 from Alexander Lakhin. Back-patch to all supported branches. Discussion: https://postgr.es/m/17098-b960f3616c861f83@postgresql.org Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1d49c888755b26d51fba03538ee2ce28478a86ad Modified Files -------------- src/backend/commands/extension.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Lock the extension during ALTER EXTENSION ADD/DROP. @ 2021-07-11 16:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2021-07-11 16:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Lock the extension during ALTER EXTENSION ADD/DROP. Although we were careful to lock the object being added or dropped, we failed to get any sort of lock on the extension itself. This allowed the ALTER to proceed in parallel with a DROP EXTENSION, which is problematic for a couple of reasons. If both commands succeeded we'd be left with a dangling link in pg_depend, which would cause problems later. Also, if the ALTER failed for some reason, it might try to print the extension's name, and that could result in a crash or (in older branches) a silly error message complaining about extension "(null)". Per bug #17098 from Alexander Lakhin. Back-patch to all supported branches. Discussion: https://postgr.es/m/17098-b960f3616c861f83@postgresql.org Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1c612bc98ec363e2464cce66526b75a0d08d657e Modified Files -------------- src/backend/commands/extension.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Lock the extension during ALTER EXTENSION ADD/DROP. @ 2021-07-11 16:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2021-07-11 16:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Lock the extension during ALTER EXTENSION ADD/DROP. Although we were careful to lock the object being added or dropped, we failed to get any sort of lock on the extension itself. This allowed the ALTER to proceed in parallel with a DROP EXTENSION, which is problematic for a couple of reasons. If both commands succeeded we'd be left with a dangling link in pg_depend, which would cause problems later. Also, if the ALTER failed for some reason, it might try to print the extension's name, and that could result in a crash or (in older branches) a silly error message complaining about extension "(null)". Per bug #17098 from Alexander Lakhin. Back-patch to all supported branches. Discussion: https://postgr.es/m/17098-b960f3616c861f83@postgresql.org Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/734be249d2c8aab31b25bcb073a1e98692bc73f6 Modified Files -------------- src/backend/commands/extension.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Lock the extension during ALTER EXTENSION ADD/DROP. @ 2021-07-11 16:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2021-07-11 16:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Lock the extension during ALTER EXTENSION ADD/DROP. Although we were careful to lock the object being added or dropped, we failed to get any sort of lock on the extension itself. This allowed the ALTER to proceed in parallel with a DROP EXTENSION, which is problematic for a couple of reasons. If both commands succeeded we'd be left with a dangling link in pg_depend, which would cause problems later. Also, if the ALTER failed for some reason, it might try to print the extension's name, and that could result in a crash or (in older branches) a silly error message complaining about extension "(null)". Per bug #17098 from Alexander Lakhin. Back-patch to all supported branches. Discussion: https://postgr.es/m/17098-b960f3616c861f83@postgresql.org Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/69dfc36fd54d1620209d5d40f3c68006d96b0046 Modified Files -------------- src/backend/commands/extension.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Lock the extension during ALTER EXTENSION ADD/DROP. @ 2021-07-11 16:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2021-07-11 16:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Lock the extension during ALTER EXTENSION ADD/DROP. Although we were careful to lock the object being added or dropped, we failed to get any sort of lock on the extension itself. This allowed the ALTER to proceed in parallel with a DROP EXTENSION, which is problematic for a couple of reasons. If both commands succeeded we'd be left with a dangling link in pg_depend, which would cause problems later. Also, if the ALTER failed for some reason, it might try to print the extension's name, and that could result in a crash or (in older branches) a silly error message complaining about extension "(null)". Per bug #17098 from Alexander Lakhin. Back-patch to all supported branches. Discussion: https://postgr.es/m/17098-b960f3616c861f83@postgresql.org Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/6bd9ae173d372480ee8aed1164ec03e03daff0a1 Modified Files -------------- src/backend/commands/extension.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Lock the extension during ALTER EXTENSION ADD/DROP. @ 2021-07-11 16:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2021-07-11 16:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Lock the extension during ALTER EXTENSION ADD/DROP. Although we were careful to lock the object being added or dropped, we failed to get any sort of lock on the extension itself. This allowed the ALTER to proceed in parallel with a DROP EXTENSION, which is problematic for a couple of reasons. If both commands succeeded we'd be left with a dangling link in pg_depend, which would cause problems later. Also, if the ALTER failed for some reason, it might try to print the extension's name, and that could result in a crash or (in older branches) a silly error message complaining about extension "(null)". Per bug #17098 from Alexander Lakhin. Back-patch to all supported branches. Discussion: https://postgr.es/m/17098-b960f3616c861f83@postgresql.org Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/92340ba5a795ad250fb797168e08ac8ed7838613 Modified Files -------------- src/backend/commands/extension.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2021-07-11 16:54 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-07-11 16:54 pgsql: Lock the extension during ALTER EXTENSION ADD/DROP. Tom Lane <tgl@sss.pgh.pa.us> 2021-07-11 16:54 pgsql: Lock the extension during ALTER EXTENSION ADD/DROP. Tom Lane <tgl@sss.pgh.pa.us> 2021-07-11 16:54 pgsql: Lock the extension during ALTER EXTENSION ADD/DROP. Tom Lane <tgl@sss.pgh.pa.us> 2021-07-11 16:54 pgsql: Lock the extension during ALTER EXTENSION ADD/DROP. Tom Lane <tgl@sss.pgh.pa.us> 2021-07-11 16:54 pgsql: Lock the extension during ALTER EXTENSION ADD/DROP. Tom Lane <tgl@sss.pgh.pa.us> 2021-07-11 16:54 pgsql: Lock the extension during ALTER EXTENSION ADD/DROP. Tom Lane <tgl@sss.pgh.pa.us> 2021-07-11 16:54 pgsql: Lock the extension during ALTER EXTENSION ADD/DROP. Tom Lane <tgl@sss.pgh.pa.us>
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