blob: 543ae89747e9d90ac62c2658e0a6d45e374d1a94 (
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
|
Parsed test spec with 3 sessions
starting permutation: s2rx s2ry s1ry s1wy s1c s2wx s2c s3c
step s2rx: SELECT balance FROM bank_account WHERE id = 'X';
balance
-------
0
(1 row)
step s2ry: SELECT balance FROM bank_account WHERE id = 'Y';
balance
-------
0
(1 row)
step s1ry: SELECT balance FROM bank_account WHERE id = 'Y';
balance
-------
0
(1 row)
step s1wy: UPDATE bank_account SET balance = 20 WHERE id = 'Y';
step s1c: COMMIT;
step s2wx: UPDATE bank_account SET balance = -11 WHERE id = 'X';
step s2c: COMMIT;
step s3c: COMMIT;
starting permutation: s2rx s2ry s1ry s1wy s1c s3r s3c s2wx
step s2rx: SELECT balance FROM bank_account WHERE id = 'X';
balance
-------
0
(1 row)
step s2ry: SELECT balance FROM bank_account WHERE id = 'Y';
balance
-------
0
(1 row)
step s1ry: SELECT balance FROM bank_account WHERE id = 'Y';
balance
-------
0
(1 row)
step s1wy: UPDATE bank_account SET balance = 20 WHERE id = 'Y';
step s1c: COMMIT;
step s3r: SELECT id, balance FROM bank_account WHERE id IN ('X', 'Y') ORDER BY id;
id|balance
--+-------
X | 0
Y | 20
(2 rows)
step s3c: COMMIT;
step s2wx: UPDATE bank_account SET balance = -11 WHERE id = 'X';
ERROR: could not serialize access due to read/write dependencies among transactions
|