pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Ensure we have a snapshot while dropping ON COMMIT DROP temp tab 7+ messages / 1 participants [nested] [flat]
* pgsql: Ensure we have a snapshot while dropping ON COMMIT DROP temp tab @ 2023-10-16 18:06 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2023-10-16 18:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure we have a snapshot while dropping ON COMMIT DROP temp tables. Dropping a temp table could entail TOAST table access to clean out toasted catalog entries, such as large pg_constraint.conbin strings for complex CHECK constraints. If we did that via ON COMMIT DROP, we triggered the assertion in init_toast_snapshot(), because there was no provision for setting up a snapshot for the drop actions. Fix that. (I assume here that the adjacent truncation actions for ON COMMIT DELETE ROWS don't have a similar problem: it doesn't seem like nontransactional truncations would need to touch any toasted fields. If that proves wrong, we could refactor a bit to have the same snapshot acquisition cover that too.) The test case added here does not fail before v15, because that assertion was added in 277692220 which was not back-patched. However, the race condition the assertion warns of surely exists further back, so back-patch to all supported branches. Per report from Richard Guo. Discussion: https://postgr.es/m/CAMbWs4-x26=_QxxgdJyNbiCDzvtr2WV5ZDso_v-CukKEe6cBZw@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/54b208f90963cb8b48b9794a5392b2fae4b40a98 Modified Files -------------- src/backend/commands/tablecmds.c | 8 ++++++++ src/test/regress/expected/temp.out | 20 ++++++++++++++++++++ src/test/regress/sql/temp.sql | 16 ++++++++++++++++ 3 files changed, 44 insertions(+) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Ensure we have a snapshot while dropping ON COMMIT DROP temp tab @ 2023-10-16 18:06 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2023-10-16 18:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure we have a snapshot while dropping ON COMMIT DROP temp tables. Dropping a temp table could entail TOAST table access to clean out toasted catalog entries, such as large pg_constraint.conbin strings for complex CHECK constraints. If we did that via ON COMMIT DROP, we triggered the assertion in init_toast_snapshot(), because there was no provision for setting up a snapshot for the drop actions. Fix that. (I assume here that the adjacent truncation actions for ON COMMIT DELETE ROWS don't have a similar problem: it doesn't seem like nontransactional truncations would need to touch any toasted fields. If that proves wrong, we could refactor a bit to have the same snapshot acquisition cover that too.) The test case added here does not fail before v15, because that assertion was added in 277692220 which was not back-patched. However, the race condition the assertion warns of surely exists further back, so back-patch to all supported branches. Per report from Richard Guo. Discussion: https://postgr.es/m/CAMbWs4-x26=_QxxgdJyNbiCDzvtr2WV5ZDso_v-CukKEe6cBZw@mail.gmail.com Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/57e6e861d437dc6bfd1d21393a7542e513789d18 Modified Files -------------- src/backend/commands/tablecmds.c | 8 ++++++++ src/test/regress/expected/temp.out | 20 ++++++++++++++++++++ src/test/regress/sql/temp.sql | 16 ++++++++++++++++ 3 files changed, 44 insertions(+) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Ensure we have a snapshot while dropping ON COMMIT DROP temp tab @ 2023-10-16 18:06 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2023-10-16 18:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure we have a snapshot while dropping ON COMMIT DROP temp tables. Dropping a temp table could entail TOAST table access to clean out toasted catalog entries, such as large pg_constraint.conbin strings for complex CHECK constraints. If we did that via ON COMMIT DROP, we triggered the assertion in init_toast_snapshot(), because there was no provision for setting up a snapshot for the drop actions. Fix that. (I assume here that the adjacent truncation actions for ON COMMIT DELETE ROWS don't have a similar problem: it doesn't seem like nontransactional truncations would need to touch any toasted fields. If that proves wrong, we could refactor a bit to have the same snapshot acquisition cover that too.) The test case added here does not fail before v15, because that assertion was added in 277692220 which was not back-patched. However, the race condition the assertion warns of surely exists further back, so back-patch to all supported branches. Per report from Richard Guo. Discussion: https://postgr.es/m/CAMbWs4-x26=_QxxgdJyNbiCDzvtr2WV5ZDso_v-CukKEe6cBZw@mail.gmail.com Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0d1a7cd14ee130ae5a1b31dd80a6aadfe9da67de Modified Files -------------- src/backend/commands/tablecmds.c | 8 ++++++++ src/test/regress/expected/temp.out | 20 ++++++++++++++++++++ src/test/regress/sql/temp.sql | 16 ++++++++++++++++ 3 files changed, 44 insertions(+) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Ensure we have a snapshot while dropping ON COMMIT DROP temp tab @ 2023-10-16 18:06 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2023-10-16 18:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure we have a snapshot while dropping ON COMMIT DROP temp tables. Dropping a temp table could entail TOAST table access to clean out toasted catalog entries, such as large pg_constraint.conbin strings for complex CHECK constraints. If we did that via ON COMMIT DROP, we triggered the assertion in init_toast_snapshot(), because there was no provision for setting up a snapshot for the drop actions. Fix that. (I assume here that the adjacent truncation actions for ON COMMIT DELETE ROWS don't have a similar problem: it doesn't seem like nontransactional truncations would need to touch any toasted fields. If that proves wrong, we could refactor a bit to have the same snapshot acquisition cover that too.) The test case added here does not fail before v15, because that assertion was added in 277692220 which was not back-patched. However, the race condition the assertion warns of surely exists further back, so back-patch to all supported branches. Per report from Richard Guo. Discussion: https://postgr.es/m/CAMbWs4-x26=_QxxgdJyNbiCDzvtr2WV5ZDso_v-CukKEe6cBZw@mail.gmail.com Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/f6e1ee3cfa3eb6fbda0e798e103dbad7760f17f5 Modified Files -------------- src/backend/commands/tablecmds.c | 8 ++++++++ src/test/regress/expected/temp.out | 20 ++++++++++++++++++++ src/test/regress/sql/temp.sql | 16 ++++++++++++++++ 3 files changed, 44 insertions(+) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Ensure we have a snapshot while dropping ON COMMIT DROP temp tab @ 2023-10-16 18:06 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2023-10-16 18:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure we have a snapshot while dropping ON COMMIT DROP temp tables. Dropping a temp table could entail TOAST table access to clean out toasted catalog entries, such as large pg_constraint.conbin strings for complex CHECK constraints. If we did that via ON COMMIT DROP, we triggered the assertion in init_toast_snapshot(), because there was no provision for setting up a snapshot for the drop actions. Fix that. (I assume here that the adjacent truncation actions for ON COMMIT DELETE ROWS don't have a similar problem: it doesn't seem like nontransactional truncations would need to touch any toasted fields. If that proves wrong, we could refactor a bit to have the same snapshot acquisition cover that too.) The test case added here does not fail before v15, because that assertion was added in 277692220 which was not back-patched. However, the race condition the assertion warns of surely exists further back, so back-patch to all supported branches. Per report from Richard Guo. Discussion: https://postgr.es/m/CAMbWs4-x26=_QxxgdJyNbiCDzvtr2WV5ZDso_v-CukKEe6cBZw@mail.gmail.com Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1e678175c575ea4af1d39cff0d8abceb3c1ae8a5 Modified Files -------------- src/backend/commands/tablecmds.c | 8 ++++++++ src/test/regress/expected/temp.out | 20 ++++++++++++++++++++ src/test/regress/sql/temp.sql | 16 ++++++++++++++++ 3 files changed, 44 insertions(+) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Ensure we have a snapshot while dropping ON COMMIT DROP temp tab @ 2023-10-16 18:06 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2023-10-16 18:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure we have a snapshot while dropping ON COMMIT DROP temp tables. Dropping a temp table could entail TOAST table access to clean out toasted catalog entries, such as large pg_constraint.conbin strings for complex CHECK constraints. If we did that via ON COMMIT DROP, we triggered the assertion in init_toast_snapshot(), because there was no provision for setting up a snapshot for the drop actions. Fix that. (I assume here that the adjacent truncation actions for ON COMMIT DELETE ROWS don't have a similar problem: it doesn't seem like nontransactional truncations would need to touch any toasted fields. If that proves wrong, we could refactor a bit to have the same snapshot acquisition cover that too.) The test case added here does not fail before v15, because that assertion was added in 277692220 which was not back-patched. However, the race condition the assertion warns of surely exists further back, so back-patch to all supported branches. Per report from Richard Guo. Discussion: https://postgr.es/m/CAMbWs4-x26=_QxxgdJyNbiCDzvtr2WV5ZDso_v-CukKEe6cBZw@mail.gmail.com Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/07eb22a7761f88a826c1d561c41aaeace23d3f7f Modified Files -------------- src/backend/commands/tablecmds.c | 8 ++++++++ src/test/regress/expected/temp.out | 20 ++++++++++++++++++++ src/test/regress/sql/temp.sql | 16 ++++++++++++++++ 3 files changed, 44 insertions(+) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Ensure we have a snapshot while dropping ON COMMIT DROP temp tab @ 2023-10-16 18:06 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2023-10-16 18:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Ensure we have a snapshot while dropping ON COMMIT DROP temp tables. Dropping a temp table could entail TOAST table access to clean out toasted catalog entries, such as large pg_constraint.conbin strings for complex CHECK constraints. If we did that via ON COMMIT DROP, we triggered the assertion in init_toast_snapshot(), because there was no provision for setting up a snapshot for the drop actions. Fix that. (I assume here that the adjacent truncation actions for ON COMMIT DELETE ROWS don't have a similar problem: it doesn't seem like nontransactional truncations would need to touch any toasted fields. If that proves wrong, we could refactor a bit to have the same snapshot acquisition cover that too.) The test case added here does not fail before v15, because that assertion was added in 277692220 which was not back-patched. However, the race condition the assertion warns of surely exists further back, so back-patch to all supported branches. Per report from Richard Guo. Discussion: https://postgr.es/m/CAMbWs4-x26=_QxxgdJyNbiCDzvtr2WV5ZDso_v-CukKEe6cBZw@mail.gmail.com Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a295684b89143bc4bf51e1b40eb195de35570feb Modified Files -------------- src/backend/commands/tablecmds.c | 8 ++++++++ src/test/regress/expected/temp.out | 20 ++++++++++++++++++++ src/test/regress/sql/temp.sql | 16 ++++++++++++++++ 3 files changed, 44 insertions(+) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2023-10-16 18:06 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-10-16 18:06 pgsql: Ensure we have a snapshot while dropping ON COMMIT DROP temp tab Tom Lane <tgl@sss.pgh.pa.us> 2023-10-16 18:06 pgsql: Ensure we have a snapshot while dropping ON COMMIT DROP temp tab Tom Lane <tgl@sss.pgh.pa.us> 2023-10-16 18:06 pgsql: Ensure we have a snapshot while dropping ON COMMIT DROP temp tab Tom Lane <tgl@sss.pgh.pa.us> 2023-10-16 18:06 pgsql: Ensure we have a snapshot while dropping ON COMMIT DROP temp tab Tom Lane <tgl@sss.pgh.pa.us> 2023-10-16 18:06 pgsql: Ensure we have a snapshot while dropping ON COMMIT DROP temp tab Tom Lane <tgl@sss.pgh.pa.us> 2023-10-16 18:06 pgsql: Ensure we have a snapshot while dropping ON COMMIT DROP temp tab Tom Lane <tgl@sss.pgh.pa.us> 2023-10-16 18:06 pgsql: Ensure we have a snapshot while dropping ON COMMIT DROP temp tab 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