Parsed test spec with 3 sessions
|
|
starting permutation: reindex upd wake_reindex reindexed swapped wake_check checked rows orphan
|
injection_points_attach
|
-----------------------
|
|
(1 row)
|
|
injection_points_attach
|
-----------------------
|
|
(1 row)
|
|
step reindex: REINDEX INDEX CONCURRENTLY ri_pk_pkey; <waiting ...>
|
step upd: UPDATE ri_fk SET pid = 42 WHERE id = 1; <waiting ...>
|
step wake_reindex:
|
SELECT injection_points_detach('reindex-relation-concurrently-before-swap');
|
SELECT injection_points_wakeup('reindex-relation-concurrently-before-swap');
|
|
injection_points_detach
|
-----------------------
|
|
(1 row)
|
|
injection_points_wakeup
|
-----------------------
|
|
(1 row)
|
|
step reindex: <... completed>
|
step reindexed:
|
step swapped:
|
SELECT count(*) = 0 AS old_index_dropped
|
FROM pg_class WHERE oid = (SELECT conindid FROM ri_old_index);
|
SELECT conindid <> (SELECT conindid FROM ri_old_index) AS constraint_moved
|
FROM pg_constraint WHERE conname = 'ri_fk_pid_fkey';
|
|
old_index_dropped
|
-----------------
|
t
|
(1 row)
|
|
constraint_moved
|
----------------
|
t
|
(1 row)
|
|
step wake_check:
|
SELECT injection_points_detach('ri-before-pk-lock');
|
SELECT injection_points_wakeup('ri-before-pk-lock');
|
|
injection_points_detach
|
-----------------------
|
|
(1 row)
|
|
injection_points_wakeup
|
-----------------------
|
|
(1 row)
|
|
step upd: <... completed>
|
step checked:
|
step rows: SELECT id, pid FROM ri_fk WHERE id IN (1, 2) ORDER BY id;
|
id|pid
|
--+---
|
1| 42
|
2| 2
|
(2 rows)
|
|
step orphan: INSERT INTO ri_fk VALUES (999, 12345);
|
ERROR: insert or update on table "ri_fk" violates foreign key constraint "ri_fk_pid_fkey"
|
|
starting permutation: park_drop reindex upd_new wake_reindex await_drop dead wake_check checked wake_drop reindexed rows orphan
|
injection_points_attach
|
-----------------------
|
|
(1 row)
|
|
injection_points_attach
|
-----------------------
|
|
(1 row)
|
|
step park_drop:
|
SELECT injection_points_attach('reindex-relation-concurrently-before-drop', 'wait');
|
|
injection_points_attach
|
-----------------------
|
|
(1 row)
|
|
step reindex: REINDEX INDEX CONCURRENTLY ri_pk_pkey; <waiting ...>
|
step upd_new: UPDATE ri_fk SET pid = 500 WHERE id = 1; <waiting ...>
|
step wake_reindex:
|
SELECT injection_points_detach('reindex-relation-concurrently-before-swap');
|
SELECT injection_points_wakeup('reindex-relation-concurrently-before-swap');
|
|
injection_points_detach
|
-----------------------
|
|
(1 row)
|
|
injection_points_wakeup
|
-----------------------
|
|
(1 row)
|
|
step await_drop:
|
DO $$
|
BEGIN
|
LOOP
|
PERFORM 1 FROM pg_stat_activity
|
WHERE wait_event = 'reindex-relation-concurrently-before-drop';
|
EXIT WHEN FOUND;
|
PERFORM pg_sleep(.1);
|
END LOOP;
|
END
|
$$;
|
|
step dead:
|
SELECT indisvalid, indisready, indislive
|
FROM pg_index WHERE indexrelid = (SELECT conindid FROM ri_old_index);
|
INSERT INTO ri_pk VALUES (500);
|
|
indisvalid|indisready|indislive
|
----------+----------+---------
|
f |f |f
|
(1 row)
|
|
step wake_check:
|
SELECT injection_points_detach('ri-before-pk-lock');
|
SELECT injection_points_wakeup('ri-before-pk-lock');
|
|
injection_points_detach
|
-----------------------
|
|
(1 row)
|
|
injection_points_wakeup
|
-----------------------
|
|
(1 row)
|
|
step upd_new: <... completed>
|
step checked:
|
step wake_drop:
|
SELECT injection_points_detach('reindex-relation-concurrently-before-drop');
|
SELECT injection_points_wakeup('reindex-relation-concurrently-before-drop');
|
|
injection_points_detach
|
-----------------------
|
|
(1 row)
|
|
injection_points_wakeup
|
-----------------------
|
|
(1 row)
|
|
step reindex: <... completed>
|
step reindexed:
|
step rows: SELECT id, pid FROM ri_fk WHERE id IN (1, 2) ORDER BY id;
|
id|pid
|
--+---
|
1|500
|
2| 2
|
(2 rows)
|
|
step orphan: INSERT INTO ri_fk VALUES (999, 12345);
|
ERROR: insert or update on table "ri_fk" violates foreign key constraint "ri_fk_pid_fkey"
|