Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
3 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
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
Parsed test spec with 2 sessions
 
starting permutation: ioc_nothing1 count2 update2 c2 wake2 insert1 c1
injection_points_attach
-----------------------
                       
(1 row)
 
step ioc_nothing1: INSERT INTO probe_a VALUES (1, 99) ON CONFLICT (key) DO NOTHING; <waiting ...>
step count2: SELECT count(*) FROM probe_b;
count
-----
    0
(1 row)
 
step update2: UPDATE probe_a SET val = 1 WHERE key = 1;
step c2: COMMIT;
step wake2: 
    SELECT injection_points_detach('check-exclusion-or-unique-constraint-conflict');
    SELECT injection_points_wakeup('check-exclusion-or-unique-constraint-conflict');
 
injection_points_detach
-----------------------
                       
(1 row)
 
injection_points_wakeup
-----------------------
                       
(1 row)
 
step ioc_nothing1: <... completed>
step insert1: INSERT INTO probe_b VALUES (1, 10);
ERROR:  could not serialize access due to read/write dependencies among transactions
step c1: COMMIT;
 
starting permutation: ioc_select1 count2 update2 c2 wake2 insert1 c1
injection_points_attach
-----------------------
                       
(1 row)
 
step ioc_select1: INSERT INTO probe_a VALUES (1, 99) ON CONFLICT (key) DO SELECT RETURNING val; <waiting ...>
step count2: SELECT count(*) FROM probe_b;
count
-----
    0
(1 row)
 
step update2: UPDATE probe_a SET val = 1 WHERE key = 1;
step c2: COMMIT;
step wake2: 
    SELECT injection_points_detach('check-exclusion-or-unique-constraint-conflict');
    SELECT injection_points_wakeup('check-exclusion-or-unique-constraint-conflict');
 
injection_points_detach
-----------------------
                       
(1 row)
 
injection_points_wakeup
-----------------------
                       
(1 row)
 
step ioc_select1: <... completed>
val
---
  0
(1 row)
 
step insert1: INSERT INTO probe_b VALUES (1, 10);
ERROR:  could not serialize access due to read/write dependencies among transactions
step c1: COMMIT;
 
starting permutation: ioc_select1_keyshare count2 update2 c2 wake2 insert1 c1
injection_points_attach
-----------------------
                       
(1 row)
 
step ioc_select1_keyshare: INSERT INTO probe_a VALUES (1, 99) ON CONFLICT (key) DO SELECT FOR KEY SHARE RETURNING val; <waiting ...>
step count2: SELECT count(*) FROM probe_b;
count
-----
    0
(1 row)
 
step update2: UPDATE probe_a SET val = 1 WHERE key = 1;
step c2: COMMIT;
step wake2: 
    SELECT injection_points_detach('check-exclusion-or-unique-constraint-conflict');
    SELECT injection_points_wakeup('check-exclusion-or-unique-constraint-conflict');
 
injection_points_detach
-----------------------
                       
(1 row)
 
injection_points_wakeup
-----------------------
                       
(1 row)
 
step ioc_select1_keyshare: <... completed>
val
---
  0
(1 row)
 
step insert1: INSERT INTO probe_b VALUES (1, 10);
ERROR:  could not serialize access due to read/write dependencies among transactions
step c1: COMMIT;