diff options
| author | Alexander Korotkov | 2024-08-24 15:48:48 +0000 |
|---|---|---|
| committer | Alexander Korotkov | 2024-08-24 15:48:48 +0000 |
| commit | 3890d90c1508125729ed20038d90513694fc3a7b (patch) | |
| tree | 5c0ed62151685aed09e62e3d48524d346c5080a7 /src/test/isolation | |
| parent | 6e8a0317b4c062d4d524b916e10ca7f351ed0793 (diff) | |
Revert support for ALTER TABLE ... MERGE/SPLIT PARTITION(S) commands
This commit reverts 1adf16b8fb, 87c21bb941, and subsequent fixes and
improvements including df64c81ca9, c99ef1811a, 9dfcac8e15, 885742b9f8,
842c9b2705, fcf80c5d5f, 96c7381c4c, f4fc7cb54b, 60ae37a8bc, 259c96fa8f,
449cdcd486, 3ca43dbbb6, 2a679ae94e, 3a82c689fd, fbd4321fd5, d53a4286d7,
c086896625, 4e5d6c4091, 04158e7fa3.
The reason for reverting is security issues related to repeatable name lookups
(CVE-2014-0062). Even though 04158e7fa3 solved part of the problem, there
are still remaining issues, which aren't feasible to even carefully analyze
before the RC deadline.
Reported-by: Noah Misch, Robert Haas
Discussion: https://postgr.es/m/20240808171351.a9.nmisch%40google.com
Backpatch-through: 17
Diffstat (limited to 'src/test/isolation')
| -rw-r--r-- | src/test/isolation/expected/partition-merge.out | 199 | ||||
| -rw-r--r-- | src/test/isolation/expected/partition-split.out | 190 | ||||
| -rw-r--r-- | src/test/isolation/isolation_schedule | 2 | ||||
| -rw-r--r-- | src/test/isolation/specs/partition-merge.spec | 54 | ||||
| -rw-r--r-- | src/test/isolation/specs/partition-split.spec | 54 |
5 files changed, 0 insertions, 499 deletions
diff --git a/src/test/isolation/expected/partition-merge.out b/src/test/isolation/expected/partition-merge.out deleted file mode 100644 index 98446aaab5a..00000000000 --- a/src/test/isolation/expected/partition-merge.out +++ /dev/null @@ -1,199 +0,0 @@ -Parsed test spec with 2 sessions - -starting permutation: s2b s2i s2c s1b s1merg s2b s2u s1c s2c s2s -step s2b: BEGIN; -step s2i: INSERT INTO tpart VALUES (1, 'text01'); -step s2c: COMMIT; -step s1b: BEGIN; -step s1merg: ALTER TABLE tpart MERGE PARTITIONS (tpart_00_10, tpart_10_20) INTO tpart_00_20; -step s2b: BEGIN; -step s2u: UPDATE tpart SET t = 'text01modif' where i = 1; <waiting ...> -step s1c: COMMIT; -step s2u: <... completed> -step s2c: COMMIT; -step s2s: SELECT * FROM tpart; - i|t ---+----------- - 5|text05 -15|text15 - 1|text01modif -25|text25 -35|text35 -(5 rows) - - -starting permutation: s2b s2i s2c s1brr s1merg s2b s2u s1c s2c s2s -step s2b: BEGIN; -step s2i: INSERT INTO tpart VALUES (1, 'text01'); -step s2c: COMMIT; -step s1brr: BEGIN ISOLATION LEVEL REPEATABLE READ; -step s1merg: ALTER TABLE tpart MERGE PARTITIONS (tpart_00_10, tpart_10_20) INTO tpart_00_20; -step s2b: BEGIN; -step s2u: UPDATE tpart SET t = 'text01modif' where i = 1; <waiting ...> -step s1c: COMMIT; -step s2u: <... completed> -step s2c: COMMIT; -step s2s: SELECT * FROM tpart; - i|t ---+----------- - 5|text05 -15|text15 - 1|text01modif -25|text25 -35|text35 -(5 rows) - - -starting permutation: s2b s2i s2c s1bs s1merg s2b s2u s1c s2c s2s -step s2b: BEGIN; -step s2i: INSERT INTO tpart VALUES (1, 'text01'); -step s2c: COMMIT; -step s1bs: BEGIN ISOLATION LEVEL SERIALIZABLE; -step s1merg: ALTER TABLE tpart MERGE PARTITIONS (tpart_00_10, tpart_10_20) INTO tpart_00_20; -step s2b: BEGIN; -step s2u: UPDATE tpart SET t = 'text01modif' where i = 1; <waiting ...> -step s1c: COMMIT; -step s2u: <... completed> -step s2c: COMMIT; -step s2s: SELECT * FROM tpart; - i|t ---+----------- - 5|text05 -15|text15 - 1|text01modif -25|text25 -35|text35 -(5 rows) - - -starting permutation: s2brr s2i s2c s1b s1merg s2b s2u s1c s2c s2s -step s2brr: BEGIN ISOLATION LEVEL REPEATABLE READ; -step s2i: INSERT INTO tpart VALUES (1, 'text01'); -step s2c: COMMIT; -step s1b: BEGIN; -step s1merg: ALTER TABLE tpart MERGE PARTITIONS (tpart_00_10, tpart_10_20) INTO tpart_00_20; -step s2b: BEGIN; -step s2u: UPDATE tpart SET t = 'text01modif' where i = 1; <waiting ...> -step s1c: COMMIT; -step s2u: <... completed> -step s2c: COMMIT; -step s2s: SELECT * FROM tpart; - i|t ---+----------- - 5|text05 -15|text15 - 1|text01modif -25|text25 -35|text35 -(5 rows) - - -starting permutation: s2brr s2i s2c s1brr s1merg s2b s2u s1c s2c s2s -step s2brr: BEGIN ISOLATION LEVEL REPEATABLE READ; -step s2i: INSERT INTO tpart VALUES (1, 'text01'); -step s2c: COMMIT; -step s1brr: BEGIN ISOLATION LEVEL REPEATABLE READ; -step s1merg: ALTER TABLE tpart MERGE PARTITIONS (tpart_00_10, tpart_10_20) INTO tpart_00_20; -step s2b: BEGIN; -step s2u: UPDATE tpart SET t = 'text01modif' where i = 1; <waiting ...> -step s1c: COMMIT; -step s2u: <... completed> -step s2c: COMMIT; -step s2s: SELECT * FROM tpart; - i|t ---+----------- - 5|text05 -15|text15 - 1|text01modif -25|text25 -35|text35 -(5 rows) - - -starting permutation: s2brr s2i s2c s1bs s1merg s2b s2u s1c s2c s2s -step s2brr: BEGIN ISOLATION LEVEL REPEATABLE READ; -step s2i: INSERT INTO tpart VALUES (1, 'text01'); -step s2c: COMMIT; -step s1bs: BEGIN ISOLATION LEVEL SERIALIZABLE; -step s1merg: ALTER TABLE tpart MERGE PARTITIONS (tpart_00_10, tpart_10_20) INTO tpart_00_20; -step s2b: BEGIN; -step s2u: UPDATE tpart SET t = 'text01modif' where i = 1; <waiting ...> -step s1c: COMMIT; -step s2u: <... completed> -step s2c: COMMIT; -step s2s: SELECT * FROM tpart; - i|t ---+----------- - 5|text05 -15|text15 - 1|text01modif -25|text25 -35|text35 -(5 rows) - - -starting permutation: s2bs s2i s2c s1b s1merg s2b s2u s1c s2c s2s -step s2bs: BEGIN ISOLATION LEVEL SERIALIZABLE; -step s2i: INSERT INTO tpart VALUES (1, 'text01'); -step s2c: COMMIT; -step s1b: BEGIN; -step s1merg: ALTER TABLE tpart MERGE PARTITIONS (tpart_00_10, tpart_10_20) INTO tpart_00_20; -step s2b: BEGIN; -step s2u: UPDATE tpart SET t = 'text01modif' where i = 1; <waiting ...> -step s1c: COMMIT; -step s2u: <... completed> -step s2c: COMMIT; -step s2s: SELECT * FROM tpart; - i|t ---+----------- - 5|text05 -15|text15 - 1|text01modif -25|text25 -35|text35 -(5 rows) - - -starting permutation: s2bs s2i s2c s1brr s1merg s2b s2u s1c s2c s2s -step s2bs: BEGIN ISOLATION LEVEL SERIALIZABLE; -step s2i: INSERT INTO tpart VALUES (1, 'text01'); -step s2c: COMMIT; -step s1brr: BEGIN ISOLATION LEVEL REPEATABLE READ; -step s1merg: ALTER TABLE tpart MERGE PARTITIONS (tpart_00_10, tpart_10_20) INTO tpart_00_20; -step s2b: BEGIN; -step s2u: UPDATE tpart SET t = 'text01modif' where i = 1; <waiting ...> -step s1c: COMMIT; -step s2u: <... completed> -step s2c: COMMIT; -step s2s: SELECT * FROM tpart; - i|t ---+----------- - 5|text05 -15|text15 - 1|text01modif -25|text25 -35|text35 -(5 rows) - - -starting permutation: s2bs s2i s2c s1bs s1merg s2b s2u s1c s2c s2s -step s2bs: BEGIN ISOLATION LEVEL SERIALIZABLE; -step s2i: INSERT INTO tpart VALUES (1, 'text01'); -step s2c: COMMIT; -step s1bs: BEGIN ISOLATION LEVEL SERIALIZABLE; -step s1merg: ALTER TABLE tpart MERGE PARTITIONS (tpart_00_10, tpart_10_20) INTO tpart_00_20; -step s2b: BEGIN; -step s2u: UPDATE tpart SET t = 'text01modif' where i = 1; <waiting ...> -step s1c: COMMIT; -step s2u: <... completed> -step s2c: COMMIT; -step s2s: SELECT * FROM tpart; - i|t ---+----------- - 5|text05 -15|text15 - 1|text01modif -25|text25 -35|text35 -(5 rows) - diff --git a/src/test/isolation/expected/partition-split.out b/src/test/isolation/expected/partition-split.out deleted file mode 100644 index 5d9e8b0925f..00000000000 --- a/src/test/isolation/expected/partition-split.out +++ /dev/null @@ -1,190 +0,0 @@ -Parsed test spec with 2 sessions - -starting permutation: s1b s1splt s2b s2i s1c s2c s2s -step s1b: BEGIN; -step s1splt: ALTER TABLE tpart SPLIT PARTITION tpart_10_20 INTO - (PARTITION tpart_10_15 FOR VALUES FROM (10) TO (15), - PARTITION tpart_15_20 FOR VALUES FROM (15) TO (20)); -step s2b: BEGIN; -step s2i: INSERT INTO tpart VALUES (1, 'text01'); <waiting ...> -step s1c: COMMIT; -step s2i: <... completed> -step s2c: COMMIT; -step s2s: SELECT * FROM tpart; - i|t ---+------ - 5|text05 - 1|text01 -15|text15 -25|text25 -35|text35 -(5 rows) - - -starting permutation: s1b s1splt s2brr s2i s1c s2c s2s -step s1b: BEGIN; -step s1splt: ALTER TABLE tpart SPLIT PARTITION tpart_10_20 INTO - (PARTITION tpart_10_15 FOR VALUES FROM (10) TO (15), - PARTITION tpart_15_20 FOR VALUES FROM (15) TO (20)); -step s2brr: BEGIN ISOLATION LEVEL REPEATABLE READ; -step s2i: INSERT INTO tpart VALUES (1, 'text01'); <waiting ...> -step s1c: COMMIT; -step s2i: <... completed> -step s2c: COMMIT; -step s2s: SELECT * FROM tpart; - i|t ---+------ - 5|text05 - 1|text01 -15|text15 -25|text25 -35|text35 -(5 rows) - - -starting permutation: s1b s1splt s2bs s2i s1c s2c s2s -step s1b: BEGIN; -step s1splt: ALTER TABLE tpart SPLIT PARTITION tpart_10_20 INTO - (PARTITION tpart_10_15 FOR VALUES FROM (10) TO (15), - PARTITION tpart_15_20 FOR VALUES FROM (15) TO (20)); -step s2bs: BEGIN ISOLATION LEVEL SERIALIZABLE; -step s2i: INSERT INTO tpart VALUES (1, 'text01'); <waiting ...> -step s1c: COMMIT; -step s2i: <... completed> -step s2c: COMMIT; -step s2s: SELECT * FROM tpart; - i|t ---+------ - 5|text05 - 1|text01 -15|text15 -25|text25 -35|text35 -(5 rows) - - -starting permutation: s1brr s1splt s2b s2i s1c s2c s2s -step s1brr: BEGIN ISOLATION LEVEL REPEATABLE READ; -step s1splt: ALTER TABLE tpart SPLIT PARTITION tpart_10_20 INTO - (PARTITION tpart_10_15 FOR VALUES FROM (10) TO (15), - PARTITION tpart_15_20 FOR VALUES FROM (15) TO (20)); -step s2b: BEGIN; -step s2i: INSERT INTO tpart VALUES (1, 'text01'); <waiting ...> -step s1c: COMMIT; -step s2i: <... completed> -step s2c: COMMIT; -step s2s: SELECT * FROM tpart; - i|t ---+------ - 5|text05 - 1|text01 -15|text15 -25|text25 -35|text35 -(5 rows) - - -starting permutation: s1brr s1splt s2brr s2i s1c s2c s2s -step s1brr: BEGIN ISOLATION LEVEL REPEATABLE READ; -step s1splt: ALTER TABLE tpart SPLIT PARTITION tpart_10_20 INTO - (PARTITION tpart_10_15 FOR VALUES FROM (10) TO (15), - PARTITION tpart_15_20 FOR VALUES FROM (15) TO (20)); -step s2brr: BEGIN ISOLATION LEVEL REPEATABLE READ; -step s2i: INSERT INTO tpart VALUES (1, 'text01'); <waiting ...> -step s1c: COMMIT; -step s2i: <... completed> -step s2c: COMMIT; -step s2s: SELECT * FROM tpart; - i|t ---+------ - 5|text05 - 1|text01 -15|text15 -25|text25 -35|text35 -(5 rows) - - -starting permutation: s1brr s1splt s2bs s2i s1c s2c s2s -step s1brr: BEGIN ISOLATION LEVEL REPEATABLE READ; -step s1splt: ALTER TABLE tpart SPLIT PARTITION tpart_10_20 INTO - (PARTITION tpart_10_15 FOR VALUES FROM (10) TO (15), - PARTITION tpart_15_20 FOR VALUES FROM (15) TO (20)); -step s2bs: BEGIN ISOLATION LEVEL SERIALIZABLE; -step s2i: INSERT INTO tpart VALUES (1, 'text01'); <waiting ...> -step s1c: COMMIT; -step s2i: <... completed> -step s2c: COMMIT; -step s2s: SELECT * FROM tpart; - i|t ---+------ - 5|text05 - 1|text01 -15|text15 -25|text25 -35|text35 -(5 rows) - - -starting permutation: s1bs s1splt s2b s2i s1c s2c s2s -step s1bs: BEGIN ISOLATION LEVEL SERIALIZABLE; -step s1splt: ALTER TABLE tpart SPLIT PARTITION tpart_10_20 INTO - (PARTITION tpart_10_15 FOR VALUES FROM (10) TO (15), - PARTITION tpart_15_20 FOR VALUES FROM (15) TO (20)); -step s2b: BEGIN; -step s2i: INSERT INTO tpart VALUES (1, 'text01'); <waiting ...> -step s1c: COMMIT; -step s2i: <... completed> -step s2c: COMMIT; -step s2s: SELECT * FROM tpart; - i|t ---+------ - 5|text05 - 1|text01 -15|text15 -25|text25 -35|text35 -(5 rows) - - -starting permutation: s1bs s1splt s2brr s2i s1c s2c s2s -step s1bs: BEGIN ISOLATION LEVEL SERIALIZABLE; -step s1splt: ALTER TABLE tpart SPLIT PARTITION tpart_10_20 INTO - (PARTITION tpart_10_15 FOR VALUES FROM (10) TO (15), - PARTITION tpart_15_20 FOR VALUES FROM (15) TO (20)); -step s2brr: BEGIN ISOLATION LEVEL REPEATABLE READ; -step s2i: INSERT INTO tpart VALUES (1, 'text01'); <waiting ...> -step s1c: COMMIT; -step s2i: <... completed> -step s2c: COMMIT; -step s2s: SELECT * FROM tpart; - i|t ---+------ - 5|text05 - 1|text01 -15|text15 -25|text25 -35|text35 -(5 rows) - - -starting permutation: s1bs s1splt s2bs s2i s1c s2c s2s -step s1bs: BEGIN ISOLATION LEVEL SERIALIZABLE; -step s1splt: ALTER TABLE tpart SPLIT PARTITION tpart_10_20 INTO - (PARTITION tpart_10_15 FOR VALUES FROM (10) TO (15), - PARTITION tpart_15_20 FOR VALUES FROM (15) TO (20)); -step s2bs: BEGIN ISOLATION LEVEL SERIALIZABLE; -step s2i: INSERT INTO tpart VALUES (1, 'text01'); <waiting ...> -step s1c: COMMIT; -step s2i: <... completed> -step s2c: COMMIT; -step s2s: SELECT * FROM tpart; - i|t ---+------ - 5|text05 - 1|text01 -15|text15 -25|text25 -35|text35 -(5 rows) - diff --git a/src/test/isolation/isolation_schedule b/src/test/isolation/isolation_schedule index 6da98cffaca..143109aa4da 100644 --- a/src/test/isolation/isolation_schedule +++ b/src/test/isolation/isolation_schedule @@ -106,8 +106,6 @@ test: partition-key-update-1 test: partition-key-update-2 test: partition-key-update-3 test: partition-key-update-4 -test: partition-merge -test: partition-split test: plpgsql-toast test: cluster-conflict test: cluster-conflict-partition diff --git a/src/test/isolation/specs/partition-merge.spec b/src/test/isolation/specs/partition-merge.spec deleted file mode 100644 index dc2b9d3445f..00000000000 --- a/src/test/isolation/specs/partition-merge.spec +++ /dev/null @@ -1,54 +0,0 @@ -# Verify that MERGE operation locks DML operations with partitioned table - -setup -{ - DROP TABLE IF EXISTS tpart; - CREATE TABLE tpart(i int, t text) partition by range(i); - CREATE TABLE tpart_00_10 PARTITION OF tpart FOR VALUES FROM (0) TO (10); - CREATE TABLE tpart_10_20 PARTITION OF tpart FOR VALUES FROM (10) TO (20); - CREATE TABLE tpart_20_30 PARTITION OF tpart FOR VALUES FROM (20) TO (30); - CREATE TABLE tpart_default PARTITION OF tpart DEFAULT; - INSERT INTO tpart VALUES (5, 'text05'); - INSERT INTO tpart VALUES (15, 'text15'); - INSERT INTO tpart VALUES (25, 'text25'); - INSERT INTO tpart VALUES (35, 'text35'); -} - -teardown -{ - DROP TABLE tpart; -} - -session s1 -step s1b { BEGIN; } -step s1brr { BEGIN ISOLATION LEVEL REPEATABLE READ; } -step s1bs { BEGIN ISOLATION LEVEL SERIALIZABLE; } -step s1merg { ALTER TABLE tpart MERGE PARTITIONS (tpart_00_10, tpart_10_20) INTO tpart_00_20; } -step s1c { COMMIT; } - - -session s2 -step s2b { BEGIN; } -step s2brr { BEGIN ISOLATION LEVEL REPEATABLE READ; } -step s2bs { BEGIN ISOLATION LEVEL SERIALIZABLE; } -step s2i { INSERT INTO tpart VALUES (1, 'text01'); } -step s2u { UPDATE tpart SET t = 'text01modif' where i = 1; } -step s2c { COMMIT; } -step s2s { SELECT * FROM tpart; } - - -# s2 inserts row into table. s1 starts MERGE PARTITIONS then -# s2 is trying to update inserted row and waits until s1 finishes -# MERGE operation. - -permutation s2b s2i s2c s1b s1merg s2b s2u s1c s2c s2s -permutation s2b s2i s2c s1brr s1merg s2b s2u s1c s2c s2s -permutation s2b s2i s2c s1bs s1merg s2b s2u s1c s2c s2s - -permutation s2brr s2i s2c s1b s1merg s2b s2u s1c s2c s2s -permutation s2brr s2i s2c s1brr s1merg s2b s2u s1c s2c s2s -permutation s2brr s2i s2c s1bs s1merg s2b s2u s1c s2c s2s - -permutation s2bs s2i s2c s1b s1merg s2b s2u s1c s2c s2s -permutation s2bs s2i s2c s1brr s1merg s2b s2u s1c s2c s2s -permutation s2bs s2i s2c s1bs s1merg s2b s2u s1c s2c s2s diff --git a/src/test/isolation/specs/partition-split.spec b/src/test/isolation/specs/partition-split.spec deleted file mode 100644 index 087239a4a19..00000000000 --- a/src/test/isolation/specs/partition-split.spec +++ /dev/null @@ -1,54 +0,0 @@ -# Verify that SPLIT operation locks DML operations with partitioned table - -setup -{ - DROP TABLE IF EXISTS tpart; - CREATE TABLE tpart(i int, t text) partition by range(i); - CREATE TABLE tpart_00_10 PARTITION OF tpart FOR VALUES FROM (0) TO (10); - CREATE TABLE tpart_10_20 PARTITION OF tpart FOR VALUES FROM (10) TO (20); - CREATE TABLE tpart_20_30 PARTITION OF tpart FOR VALUES FROM (20) TO (30); - CREATE TABLE tpart_default PARTITION OF tpart DEFAULT; - INSERT INTO tpart VALUES (5, 'text05'); - INSERT INTO tpart VALUES (15, 'text15'); - INSERT INTO tpart VALUES (25, 'text25'); - INSERT INTO tpart VALUES (35, 'text35'); -} - -teardown -{ - DROP TABLE tpart; -} - -session s1 -step s1b { BEGIN; } -step s1brr { BEGIN ISOLATION LEVEL REPEATABLE READ; } -step s1bs { BEGIN ISOLATION LEVEL SERIALIZABLE; } -step s1splt { ALTER TABLE tpart SPLIT PARTITION tpart_10_20 INTO - (PARTITION tpart_10_15 FOR VALUES FROM (10) TO (15), - PARTITION tpart_15_20 FOR VALUES FROM (15) TO (20)); } -step s1c { COMMIT; } - - -session s2 -step s2b { BEGIN; } -step s2brr { BEGIN ISOLATION LEVEL REPEATABLE READ; } -step s2bs { BEGIN ISOLATION LEVEL SERIALIZABLE; } -step s2i { INSERT INTO tpart VALUES (1, 'text01'); } -step s2c { COMMIT; } -step s2s { SELECT * FROM tpart; } - - -# s1 starts SPLIT PARTITION then s2 trying to insert row and -# waits until s1 finished SPLIT operation. - -permutation s1b s1splt s2b s2i s1c s2c s2s -permutation s1b s1splt s2brr s2i s1c s2c s2s -permutation s1b s1splt s2bs s2i s1c s2c s2s - -permutation s1brr s1splt s2b s2i s1c s2c s2s -permutation s1brr s1splt s2brr s2i s1c s2c s2s -permutation s1brr s1splt s2bs s2i s1c s2c s2s - -permutation s1bs s1splt s2b s2i s1c s2c s2s -permutation s1bs s1splt s2brr s2i s1c s2c s2s -permutation s1bs s1splt s2bs s2i s1c s2c s2s |
