1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
Parsed test spec with 3 sessions
starting permutation: s1begin s1lock s2begin s2drop s1select s3getlocks s1commit s3getlocks s2commit
step s1begin: BEGIN;
step s1lock: LOCK TABLE part_drop_index_locking_subpart_child IN ACCESS SHARE MODE;
step s2begin: BEGIN;
step s2drop: DROP INDEX part_drop_index_locking_idx; <waiting ...>
step s1select: SELECT * FROM part_drop_index_locking_subpart_child;
id
--
(0 rows)
step s3getlocks:
SELECT s.query, c.relname, l.mode, l.granted
FROM pg_locks l
JOIN pg_class c ON l.relation = c.oid
JOIN pg_stat_activity s ON l.pid = s.pid
WHERE c.relname LIKE 'part_drop_index_locking%'
ORDER BY s.query, c.relname, l.mode, l.granted;
query |relname |mode |granted
----------------------------------------------------+---------------------------------------------+-------------------+-------
DROP INDEX part_drop_index_locking_idx; |part_drop_index_locking |AccessExclusiveLock|t
DROP INDEX part_drop_index_locking_idx; |part_drop_index_locking_idx |AccessExclusiveLock|t
DROP INDEX part_drop_index_locking_idx; |part_drop_index_locking_subpart |AccessExclusiveLock|t
DROP INDEX part_drop_index_locking_idx; |part_drop_index_locking_subpart_child |AccessExclusiveLock|f
SELECT * FROM part_drop_index_locking_subpart_child;|part_drop_index_locking_subpart_child |AccessShareLock |t
SELECT * FROM part_drop_index_locking_subpart_child;|part_drop_index_locking_subpart_child_id_idx |AccessShareLock |t
SELECT * FROM part_drop_index_locking_subpart_child;|part_drop_index_locking_subpart_child_id_idx1|AccessShareLock |t
(7 rows)
step s1commit: COMMIT;
step s2drop: <... completed>
step s3getlocks:
SELECT s.query, c.relname, l.mode, l.granted
FROM pg_locks l
JOIN pg_class c ON l.relation = c.oid
JOIN pg_stat_activity s ON l.pid = s.pid
WHERE c.relname LIKE 'part_drop_index_locking%'
ORDER BY s.query, c.relname, l.mode, l.granted;
query |relname |mode |granted
---------------------------------------+--------------------------------------------+-------------------+-------
DROP INDEX part_drop_index_locking_idx;|part_drop_index_locking |AccessExclusiveLock|t
DROP INDEX part_drop_index_locking_idx;|part_drop_index_locking_idx |AccessExclusiveLock|t
DROP INDEX part_drop_index_locking_idx;|part_drop_index_locking_subpart |AccessExclusiveLock|t
DROP INDEX part_drop_index_locking_idx;|part_drop_index_locking_subpart_child |AccessExclusiveLock|t
DROP INDEX part_drop_index_locking_idx;|part_drop_index_locking_subpart_child_id_idx|AccessExclusiveLock|t
DROP INDEX part_drop_index_locking_idx;|part_drop_index_locking_subpart_id_idx |AccessExclusiveLock|t
(6 rows)
step s2commit: COMMIT;
starting permutation: s1begin s1lock s2begin s2dropsub s1select s3getlocks s1commit s3getlocks s2commit
step s1begin: BEGIN;
step s1lock: LOCK TABLE part_drop_index_locking_subpart_child IN ACCESS SHARE MODE;
step s2begin: BEGIN;
step s2dropsub: DROP INDEX part_drop_index_locking_subpart_idx; <waiting ...>
step s1select: SELECT * FROM part_drop_index_locking_subpart_child;
id
--
(0 rows)
step s3getlocks:
SELECT s.query, c.relname, l.mode, l.granted
FROM pg_locks l
JOIN pg_class c ON l.relation = c.oid
JOIN pg_stat_activity s ON l.pid = s.pid
WHERE c.relname LIKE 'part_drop_index_locking%'
ORDER BY s.query, c.relname, l.mode, l.granted;
query |relname |mode |granted
----------------------------------------------------+---------------------------------------------+-------------------+-------
DROP INDEX part_drop_index_locking_subpart_idx; |part_drop_index_locking_subpart |AccessExclusiveLock|t
DROP INDEX part_drop_index_locking_subpart_idx; |part_drop_index_locking_subpart_child |AccessExclusiveLock|f
DROP INDEX part_drop_index_locking_subpart_idx; |part_drop_index_locking_subpart_idx |AccessExclusiveLock|t
SELECT * FROM part_drop_index_locking_subpart_child;|part_drop_index_locking_subpart_child |AccessShareLock |t
SELECT * FROM part_drop_index_locking_subpart_child;|part_drop_index_locking_subpart_child_id_idx |AccessShareLock |t
SELECT * FROM part_drop_index_locking_subpart_child;|part_drop_index_locking_subpart_child_id_idx1|AccessShareLock |t
(6 rows)
step s1commit: COMMIT;
step s2dropsub: <... completed>
step s3getlocks:
SELECT s.query, c.relname, l.mode, l.granted
FROM pg_locks l
JOIN pg_class c ON l.relation = c.oid
JOIN pg_stat_activity s ON l.pid = s.pid
WHERE c.relname LIKE 'part_drop_index_locking%'
ORDER BY s.query, c.relname, l.mode, l.granted;
query |relname |mode |granted
-----------------------------------------------+---------------------------------------------+-------------------+-------
DROP INDEX part_drop_index_locking_subpart_idx;|part_drop_index_locking_subpart |AccessExclusiveLock|t
DROP INDEX part_drop_index_locking_subpart_idx;|part_drop_index_locking_subpart_child |AccessExclusiveLock|t
DROP INDEX part_drop_index_locking_subpart_idx;|part_drop_index_locking_subpart_child_id_idx1|AccessExclusiveLock|t
DROP INDEX part_drop_index_locking_subpart_idx;|part_drop_index_locking_subpart_idx |AccessExclusiveLock|t
(4 rows)
step s2commit: COMMIT;
|