Исходный код СУБД 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
Parsed test spec with 2 sessions
 
starting permutation: s1rr s2rr s2ins s1del s2c s1c
step s1rr: BEGIN ISOLATION LEVEL REPEATABLE READ;
step s2rr: BEGIN ISOLATION LEVEL REPEATABLE READ;
step s2ins: 
  INSERT INTO child VALUES ('[1,2)', '[2020-01-01,2025-01-01)', '[1,2)');
 
step s1del: DELETE FROM parent WHERE id = '[1,2)'; <waiting ...>
step s2c: COMMIT;
step s1del: <... completed>
ERROR:  update or delete on table "parent" violates foreign key constraint "child_parent_id_valid_at_fkey" on table "child"
step s1c: COMMIT;
 
starting permutation: s1rr s2rr s1del s2ins s1c s2c
step s1rr: BEGIN ISOLATION LEVEL REPEATABLE READ;
step s2rr: BEGIN ISOLATION LEVEL REPEATABLE READ;
step s1del: DELETE FROM parent WHERE id = '[1,2)';
step s2ins: 
  INSERT INTO child VALUES ('[1,2)', '[2020-01-01,2025-01-01)', '[1,2)');
 <waiting ...>
step s1c: COMMIT;
step s2ins: <... completed>
ERROR:  could not serialize access due to concurrent delete
step s2c: COMMIT;
 
starting permutation: s1rc s2rc s2ins s1del s2c s1c
step s1rc: BEGIN ISOLATION LEVEL READ COMMITTED;
step s2rc: BEGIN ISOLATION LEVEL READ COMMITTED;
step s2ins: 
  INSERT INTO child VALUES ('[1,2)', '[2020-01-01,2025-01-01)', '[1,2)');
 
step s1del: DELETE FROM parent WHERE id = '[1,2)'; <waiting ...>
step s2c: COMMIT;
step s1del: <... completed>
ERROR:  update or delete on table "parent" violates foreign key constraint "child_parent_id_valid_at_fkey" on table "child"
step s1c: COMMIT;
 
starting permutation: s1rc s2rc s1del s2ins s1c s2c
step s1rc: BEGIN ISOLATION LEVEL READ COMMITTED;
step s2rc: BEGIN ISOLATION LEVEL READ COMMITTED;
step s1del: DELETE FROM parent WHERE id = '[1,2)';
step s2ins: 
  INSERT INTO child VALUES ('[1,2)', '[2020-01-01,2025-01-01)', '[1,2)');
 <waiting ...>
step s1c: COMMIT;
step s2ins: <... completed>
ERROR:  insert or update on table "child" violates foreign key constraint "child_parent_id_valid_at_fkey"
step s2c: COMMIT;
 
starting permutation: s1ser s2ser s2ins s1del s2c s1c
step s1ser: BEGIN ISOLATION LEVEL SERIALIZABLE;
step s2ser: BEGIN ISOLATION LEVEL SERIALIZABLE;
step s2ins: 
  INSERT INTO child VALUES ('[1,2)', '[2020-01-01,2025-01-01)', '[1,2)');
 
step s1del: DELETE FROM parent WHERE id = '[1,2)'; <waiting ...>
step s2c: COMMIT;
step s1del: <... completed>
ERROR:  update or delete on table "parent" violates foreign key constraint "child_parent_id_valid_at_fkey" on table "child"
step s1c: COMMIT;
 
starting permutation: s1ser s2ser s1del s2ins s1c s2c
step s1ser: BEGIN ISOLATION LEVEL SERIALIZABLE;
step s2ser: BEGIN ISOLATION LEVEL SERIALIZABLE;
step s1del: DELETE FROM parent WHERE id = '[1,2)';
step s2ins: 
  INSERT INTO child VALUES ('[1,2)', '[2020-01-01,2025-01-01)', '[1,2)');
 <waiting ...>
step s1c: COMMIT;
step s2ins: <... completed>
ERROR:  could not serialize access due to concurrent delete
step s2c: COMMIT;
 
starting permutation: s1rc s2rc s2ins s1upok s2c s1c
step s1rc: BEGIN ISOLATION LEVEL READ COMMITTED;
step s2rc: BEGIN ISOLATION LEVEL READ COMMITTED;
step s2ins: 
  INSERT INTO child VALUES ('[1,2)', '[2020-01-01,2025-01-01)', '[1,2)');
 
step s1upok: UPDATE parent SET valid_at = '[2020-01-01,2026-01-01)' WHERE id = '[1,2)'; <waiting ...>
step s2c: COMMIT;
step s1upok: <... completed>
step s1c: COMMIT;
 
starting permutation: s1rc s2rc s1upok s2ins s1c s2c
step s1rc: BEGIN ISOLATION LEVEL READ COMMITTED;
step s2rc: BEGIN ISOLATION LEVEL READ COMMITTED;
step s1upok: UPDATE parent SET valid_at = '[2020-01-01,2026-01-01)' WHERE id = '[1,2)';
step s2ins: 
  INSERT INTO child VALUES ('[1,2)', '[2020-01-01,2025-01-01)', '[1,2)');
 <waiting ...>
step s1c: COMMIT;
step s2ins: <... completed>
step s2c: COMMIT;
 
starting permutation: s1rr s2rr s2ins s1upok s2c s1c
step s1rr: BEGIN ISOLATION LEVEL REPEATABLE READ;
step s2rr: BEGIN ISOLATION LEVEL REPEATABLE READ;
step s2ins: 
  INSERT INTO child VALUES ('[1,2)', '[2020-01-01,2025-01-01)', '[1,2)');
 
step s1upok: UPDATE parent SET valid_at = '[2020-01-01,2026-01-01)' WHERE id = '[1,2)'; <waiting ...>
step s2c: COMMIT;
step s1upok: <... completed>
step s1c: COMMIT;
 
starting permutation: s1rr s2rr s1upok s2ins s1c s2c
step s1rr: BEGIN ISOLATION LEVEL REPEATABLE READ;
step s2rr: BEGIN ISOLATION LEVEL REPEATABLE READ;
step s1upok: UPDATE parent SET valid_at = '[2020-01-01,2026-01-01)' WHERE id = '[1,2)';
step s2ins: 
  INSERT INTO child VALUES ('[1,2)', '[2020-01-01,2025-01-01)', '[1,2)');
 <waiting ...>
step s1c: COMMIT;
step s2ins: <... completed>
ERROR:  could not serialize access due to concurrent update
step s2c: COMMIT;
 
starting permutation: s1ser s2ser s2ins s1upok s2c s1c
step s1ser: BEGIN ISOLATION LEVEL SERIALIZABLE;
step s2ser: BEGIN ISOLATION LEVEL SERIALIZABLE;
step s2ins: 
  INSERT INTO child VALUES ('[1,2)', '[2020-01-01,2025-01-01)', '[1,2)');
 
step s1upok: UPDATE parent SET valid_at = '[2020-01-01,2026-01-01)' WHERE id = '[1,2)'; <waiting ...>
step s2c: COMMIT;
step s1upok: <... completed>
step s1c: COMMIT;
 
starting permutation: s1ser s2ser s1upok s2ins s1c s2c
step s1ser: BEGIN ISOLATION LEVEL SERIALIZABLE;
step s2ser: BEGIN ISOLATION LEVEL SERIALIZABLE;
step s1upok: UPDATE parent SET valid_at = '[2020-01-01,2026-01-01)' WHERE id = '[1,2)';
step s2ins: 
  INSERT INTO child VALUES ('[1,2)', '[2020-01-01,2025-01-01)', '[1,2)');
 <waiting ...>
step s1c: COMMIT;
step s2ins: <... completed>
ERROR:  could not serialize access due to concurrent update
step s2c: COMMIT;
 
starting permutation: s1rc s2rc s2ins s1upbad s2c s1c
step s1rc: BEGIN ISOLATION LEVEL READ COMMITTED;
step s2rc: BEGIN ISOLATION LEVEL READ COMMITTED;
step s2ins: 
  INSERT INTO child VALUES ('[1,2)', '[2020-01-01,2025-01-01)', '[1,2)');
 
step s1upbad: UPDATE parent SET valid_at = '[2020-01-01,2024-01-01)' WHERE id = '[1,2)'; <waiting ...>
step s2c: COMMIT;
step s1upbad: <... completed>
ERROR:  update or delete on table "parent" violates foreign key constraint "child_parent_id_valid_at_fkey" on table "child"
step s1c: COMMIT;
 
starting permutation: s1rc s2rc s1upbad s2ins s1c s2c
step s1rc: BEGIN ISOLATION LEVEL READ COMMITTED;
step s2rc: BEGIN ISOLATION LEVEL READ COMMITTED;
step s1upbad: UPDATE parent SET valid_at = '[2020-01-01,2024-01-01)' WHERE id = '[1,2)';
step s2ins: 
  INSERT INTO child VALUES ('[1,2)', '[2020-01-01,2025-01-01)', '[1,2)');
 <waiting ...>
step s1c: COMMIT;
step s2ins: <... completed>
ERROR:  insert or update on table "child" violates foreign key constraint "child_parent_id_valid_at_fkey"
step s2c: COMMIT;
 
starting permutation: s1rr s2rr s2ins s1upbad s2c s1c
step s1rr: BEGIN ISOLATION LEVEL REPEATABLE READ;
step s2rr: BEGIN ISOLATION LEVEL REPEATABLE READ;
step s2ins: 
  INSERT INTO child VALUES ('[1,2)', '[2020-01-01,2025-01-01)', '[1,2)');
 
step s1upbad: UPDATE parent SET valid_at = '[2020-01-01,2024-01-01)' WHERE id = '[1,2)'; <waiting ...>
step s2c: COMMIT;
step s1upbad: <... completed>
ERROR:  update or delete on table "parent" violates foreign key constraint "child_parent_id_valid_at_fkey" on table "child"
step s1c: COMMIT;
 
starting permutation: s1rr s2rr s1upbad s2ins s1c s2c
step s1rr: BEGIN ISOLATION LEVEL REPEATABLE READ;
step s2rr: BEGIN ISOLATION LEVEL REPEATABLE READ;
step s1upbad: UPDATE parent SET valid_at = '[2020-01-01,2024-01-01)' WHERE id = '[1,2)';
step s2ins: 
  INSERT INTO child VALUES ('[1,2)', '[2020-01-01,2025-01-01)', '[1,2)');
 <waiting ...>
step s1c: COMMIT;
step s2ins: <... completed>
ERROR:  could not serialize access due to concurrent update
step s2c: COMMIT;
 
starting permutation: s1ser s2ser s2ins s1upbad s2c s1c
step s1ser: BEGIN ISOLATION LEVEL SERIALIZABLE;
step s2ser: BEGIN ISOLATION LEVEL SERIALIZABLE;
step s2ins: 
  INSERT INTO child VALUES ('[1,2)', '[2020-01-01,2025-01-01)', '[1,2)');
 
step s1upbad: UPDATE parent SET valid_at = '[2020-01-01,2024-01-01)' WHERE id = '[1,2)'; <waiting ...>
step s2c: COMMIT;
step s1upbad: <... completed>
ERROR:  update or delete on table "parent" violates foreign key constraint "child_parent_id_valid_at_fkey" on table "child"
step s1c: COMMIT;
 
starting permutation: s1ser s2ser s1upbad s2ins s1c s2c
step s1ser: BEGIN ISOLATION LEVEL SERIALIZABLE;
step s2ser: BEGIN ISOLATION LEVEL SERIALIZABLE;
step s1upbad: UPDATE parent SET valid_at = '[2020-01-01,2024-01-01)' WHERE id = '[1,2)';
step s2ins: 
  INSERT INTO child VALUES ('[1,2)', '[2020-01-01,2025-01-01)', '[1,2)');
 <waiting ...>
step s1c: COMMIT;
step s2ins: <... completed>
ERROR:  could not serialize access due to concurrent update
step s2c: COMMIT;