forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5940ffb
committed
Avoid update conflict out serialization anomalies.
SSI's HeapCheckForSerializableConflictOut() test failed to correctlyhandle conditions involving a concurrently inserted tuple which is laterconcurrently updated by a separate transaction . A SELECT statementthat called HeapCheckForSerializableConflictOut() could end up using thesame XID (updater's XID) for both the original tuple, and the successortuple, missing the XID of the xact that created the original tupleentirely. This only happened when neither tuple from the chain wasvisible to the transaction's MVCC snapshot.The observable symptoms of this bug were subtle. A pair of transactionscould commit, with the later transaction failing to observe the effectsof the earlier transaction (because of the confusion created by theupdate to the non-visible row). This bug dates all the way back tocommitdafaa3e, which added SSI.To fix, make sure that we check the xmin of concurrently inserted tuplesthat happen to also have been updated concurrently.Author: Peter GeogheganReported-By: Kyle KingsburyReviewed-By: Thomas MunroDiscussion:https://postgr.es/m/db7b729d-0226-d162-a126-8a8ab2dc4443@jepsen.ioBackpatch: All supported versions1 parentd9fa17a commit5940ffb
File tree
4 files changed
+98
-5
lines changed- src
- backend/access/heap
- test/isolation
- expected
- specs
4 files changed
+98
-5
lines changedLines changed: 16 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9007 | 9007 |
| |
9008 | 9008 |
| |
9009 | 9009 |
| |
| 9010 | + | |
| 9011 | + | |
| 9012 | + | |
| 9013 | + | |
9010 | 9014 |
| |
9011 | 9015 |
| |
9012 | 9016 |
| |
| |||
9017 | 9021 |
| |
9018 | 9022 |
| |
9019 | 9023 |
| |
9020 |
| - | |
9021 |
| - | |
9022 |
| - | |
9023 |
| - | |
9024 | 9024 |
| |
9025 |
| - | |
| 9025 | + | |
| 9026 | + | |
| 9027 | + | |
| 9028 | + | |
| 9029 | + | |
| 9030 | + | |
| 9031 | + | |
| 9032 | + | |
| 9033 | + | |
| 9034 | + | |
| 9035 | + | |
9026 | 9036 |
| |
9027 | 9037 |
| |
9028 | 9038 |
| |
9029 | 9039 |
| |
9030 | 9040 |
| |
| 9041 | + | |
9031 | 9042 |
| |
9032 | 9043 |
| |
9033 | 9044 |
| |
|
Lines changed: 27 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 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 | + |
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| 21 | + | |
21 | 22 |
| |
22 | 23 |
| |
23 | 24 |
| |
|
Lines changed: 54 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 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 | + |
0 commit comments
Comments
(0)