Skip to content

Commit 31a877f

Browse files
committed
Allow drop-index-concurrently-1 test to run at any isolation level.
It previously reported failure at REPEATABLE READ and SERIALIZABLE transaction isolation levels for make installcheck.
1 parent 6648775 commit 31a877f

File tree

3 files changed

+52
-3
lines changed

3 files changed

+52
-3
lines changed

src/test/isolation/expected/drop-index-concurrently-1.out

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
Parsed test spec with 3 sessions
22

3-
starting permutation: noseq prepi preps begin explaini explains select2 drop insert2 end2 selecti selects end
3+
starting permutation: noseq chkiso prepi preps begin explaini explains select2 drop insert2 end2 selecti selects end
44
step noseq: SET enable_seqscan = false;
5+
step chkiso: SELECT (setting in ('read committed','read uncommitted')) AS is_read_committed FROM pg_settings WHERE name = 'default_transaction_isolation';
6+
is_read_committed
7+
8+
t
59
step prepi: PREPARE getrow_idx AS SELECT * FROM test_dc WHERE data=34 ORDER BY id,data;
610
step preps: PREPARE getrow_seq AS SELECT * FROM test_dc WHERE data::text=34::text ORDER BY id,data;
711
step begin: BEGIN;
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Parsed test spec with 3 sessions
2+
3+
starting permutation: noseq chkiso prepi preps begin explaini explains select2 drop insert2 end2 selecti selects end
4+
step noseq: SET enable_seqscan = false;
5+
step chkiso: SELECT (setting in ('read committed','read uncommitted')) AS is_read_committed FROM pg_settings WHERE name = 'default_transaction_isolation';
6+
is_read_committed
7+
8+
f
9+
step prepi: PREPARE getrow_idx AS SELECT * FROM test_dc WHERE data=34 ORDER BY id,data;
10+
step preps: PREPARE getrow_seq AS SELECT * FROM test_dc WHERE data::text=34::text ORDER BY id,data;
11+
step begin: BEGIN;
12+
step explaini: EXPLAIN (COSTS OFF) EXECUTE getrow_idx;
13+
QUERY PLAN
14+
15+
Sort
16+
Sort Key: id
17+
-> Index Scan using test_dc_data on test_dc
18+
Index Cond: (data = 34)
19+
step explains: EXPLAIN (COSTS OFF) EXECUTE getrow_seq;
20+
QUERY PLAN
21+
22+
Sort
23+
Sort Key: id, data
24+
-> Seq Scan on test_dc
25+
Filter: ((data)::text = '34'::text)
26+
step select2: SELECT * FROM test_dc WHERE data=34 ORDER BY id,data;
27+
id data
28+
29+
34 34
30+
step drop: DROP INDEX CONCURRENTLY test_dc_data; <waiting ...>
31+
step insert2: INSERT INTO test_dc(data) SELECT * FROM generate_series(1, 100);
32+
step end2: COMMIT;
33+
step selecti: EXECUTE getrow_idx;
34+
id data
35+
36+
34 34
37+
step selects: EXECUTE getrow_seq;
38+
id data
39+
40+
34 34
41+
step end: COMMIT;
42+
step drop: <... completed>

src/test/isolation/specs/drop-index-concurrently-1.spec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# DROP INDEX CONCURRENTLY
22
#
33
# This test shows that the concurrent write behaviour works correctly
4-
# with the expected output being 2 rows.
4+
# with the expected output being 2 rows at the READ COMMITTED and READ
5+
# UNCOMMITTED transaction isolation levels, and 1 row at the other
6+
# transaction isolation levels.
57
#
68
setup
79
{
@@ -17,6 +19,7 @@ teardown
1719

1820
session "s1"
1921
step "noseq" { SET enable_seqscan = false; }
22+
step "chkiso" { SELECT (setting in ('read committed','read uncommitted')) AS is_read_committed FROM pg_settings WHERE name = 'default_transaction_isolation'; }
2023
step "prepi" { PREPARE getrow_idx AS SELECT * FROM test_dc WHERE data=34 ORDER BY id,data; }
2124
step "preps" { PREPARE getrow_seq AS SELECT * FROM test_dc WHERE data::text=34::text ORDER BY id,data; }
2225
step "begin" { BEGIN; }
@@ -35,4 +38,4 @@ step "end2" { COMMIT; }
3538
session "s3"
3639
step "drop" { DROP INDEX CONCURRENTLY test_dc_data; }
3740

38-
permutation "noseq" "prepi" "preps" "begin" "explaini" "explains" "select2" "drop" "insert2" "end2" "selecti" "selects" "end"
41+
permutation "noseq" "chkiso" "prepi" "preps" "begin" "explaini" "explains" "select2" "drop" "insert2" "end2" "selecti" "selects" "end"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy