summaryrefslogtreecommitdiff
path: root/src/test/modules/injection_points/expected/index-concurrently-upsert.out
blob: a2ef122625c0ee7306e95f0e1b32c2fa1cadf2be (plain)
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Parsed test spec with 5 sessions

starting permutation: s1_attach_invalidate_catalog_snapshot s4_wakeup_s1_setup s3_start_create_index s1_start_upsert s4_wakeup_define_index_before_set_valid s2_start_upsert s5_wakeup_s1_from_invalidate_catalog_snapshot s4_wakeup_s2 s4_wakeup_s1
injection_points_attach
-----------------------
                       
(1 row)

injection_points_attach
-----------------------
                       
(1 row)

injection_points_attach
-----------------------
                       
(1 row)

step s1_attach_invalidate_catalog_snapshot: 
	SELECT injection_points_attach('invalidate-catalog-snapshot-end', 'wait');

injection_points_attach
-----------------------
                       
(1 row)

step s4_wakeup_s1_setup: 
	SELECT CASE WHEN
			(SELECT pid FROM pg_stat_activity
				  WHERE wait_event_type = 'InjectionPoint' AND
				  wait_event = 'invalidate-catalog-snapshot-end') IS NOT NULL
			THEN injection_points_wakeup('invalidate-catalog-snapshot-end')
		END;

case
----
    
(1 row)

step s3_start_create_index: 
	CREATE UNIQUE INDEX CONCURRENTLY tbl_pkey_duplicate ON test.tbl(i);
 <waiting ...>
step s1_start_upsert: 
	INSERT INTO test.tbl VALUES (13,now()) ON CONFLICT (i) DO UPDATE SET updated_at = now();
 <waiting ...>
step s4_wakeup_define_index_before_set_valid: 
	SELECT injection_points_detach('define-index-before-set-valid');
	SELECT injection_points_wakeup('define-index-before-set-valid');

injection_points_detach
-----------------------
                       
(1 row)

injection_points_wakeup
-----------------------
                       
(1 row)

step s2_start_upsert: 
	INSERT INTO test.tbl VALUES (13,now()) ON CONFLICT (i) DO UPDATE SET updated_at = now();
 <waiting ...>
step s5_wakeup_s1_from_invalidate_catalog_snapshot: 
	DO $$
		DECLARE
			v_waiting_pid INTEGER;
		BEGIN
		LOOP
			SELECT pid INTO v_waiting_pid
			  FROM pg_stat_activity
			 WHERE wait_event_type = 'InjectionPoint'
				   AND wait_event = 'invalidate-catalog-snapshot-end'
			 LIMIT 1;
			EXIT WHEN v_waiting_pid IS NOT NULL;
			PERFORM pg_sleep(100);
		END LOOP;
		END
	$$;

	SELECT injection_points_detach('invalidate-catalog-snapshot-end');
	SELECT injection_points_wakeup('invalidate-catalog-snapshot-end');

injection_points_detach
-----------------------
                       
(1 row)

injection_points_wakeup
-----------------------
                       
(1 row)

step s4_wakeup_s2: 
	SELECT injection_points_detach('exec-insert-before-insert-speculative');
	SELECT injection_points_wakeup('exec-insert-before-insert-speculative');

injection_points_detach
-----------------------
                       
(1 row)

injection_points_wakeup
-----------------------
                       
(1 row)

step s4_wakeup_s1: 
	SELECT injection_points_detach('check-exclusion-or-unique-constraint-no-conflict');
	SELECT injection_points_wakeup('check-exclusion-or-unique-constraint-no-conflict');

injection_points_detach
-----------------------
                       
(1 row)

injection_points_wakeup
-----------------------
                       
(1 row)

step s1_start_upsert: <... completed>
step s2_start_upsert: <... completed>
step s3_start_create_index: <... completed>