- Notifications
You must be signed in to change notification settings - Fork5
Commit406d618
committed
SSI has a race condition, where the order of commit sequence numbers of
transactions might not match the order the work done in those transactionsbecome visible to others. The logic in SSI, however, assumed that it does.Fix that by having two sequence numbers for each serializable transaction,one taken before a transaction becomes visible to others, and one after it.This is easier than trying to make the the transition totally atomic, whichwould require holding ProcArrayLock and SerializableXactHashLock at the sametime. By using prepareSeqNo instead of commitSeqNo in a few places wherecommit sequence numbers are compared, we can make those comparisons err onthe safe side when we don't know for sure which committed first.Per analysis by Kevin Grittner and Dan Ports, but this approach to fix itis different from the original patch.1 parentd7fb493 commit406d618
File tree
2 files changed
+30
-20
lines changed- src
- backend/storage/lmgr
- include/storage
2 files changed
+30
-20
lines changedLines changed: 11 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1190 | 1190 |
| |
1191 | 1191 |
| |
1192 | 1192 |
| |
| 1193 | + | |
1193 | 1194 |
| |
1194 | 1195 |
| |
1195 | 1196 |
| |
| |||
1650 | 1651 |
| |
1651 | 1652 |
| |
1652 | 1653 |
| |
| 1654 | + | |
1653 | 1655 |
| |
1654 | 1656 |
| |
1655 | 1657 |
| |
| |||
3267 | 3269 |
| |
3268 | 3270 |
| |
3269 | 3271 |
| |
3270 |
| - | |
3271 |
| - | |
| 3272 | + | |
| 3273 | + | |
3272 | 3274 |
| |
3273 | 3275 |
| |
3274 | 3276 |
| |
| |||
4407 | 4409 |
| |
4408 | 4410 |
| |
4409 | 4411 |
| |
4410 |
| - | |
4411 |
| - | |
4412 |
| - | |
4413 |
| - | |
4414 |
| - | |
4415 | 4412 |
| |
4416 | 4413 |
| |
4417 |
| - | |
| 4414 | + | |
4418 | 4415 |
| |
4419 |
| - | |
| 4416 | + | |
4420 | 4417 |
| |
4421 |
| - | |
| 4418 | + | |
4422 | 4419 |
| |
4423 | 4420 |
| |
4424 | 4421 |
| |
| |||
4459 | 4456 |
| |
4460 | 4457 |
| |
4461 | 4458 |
| |
4462 |
| - | |
4463 |
| - | |
4464 |
| - | |
4465 |
| - | |
4466 |
| - | |
4467 |
| - | |
4468 | 4459 |
| |
4469 | 4460 |
| |
4470 |
| - | |
| 4461 | + | |
4471 | 4462 |
| |
4472 |
| - | |
| 4463 | + | |
4473 | 4464 |
| |
4474 | 4465 |
| |
4475 | 4466 |
| |
| |||
4608 | 4599 |
| |
4609 | 4600 |
| |
4610 | 4601 |
| |
| 4602 | + | |
4611 | 4603 |
| |
4612 | 4604 |
| |
4613 | 4605 |
| |
| |||
4782 | 4774 |
| |
4783 | 4775 |
| |
4784 | 4776 |
| |
| 4777 | + | |
4785 | 4778 |
| |
4786 | 4779 |
| |
4787 | 4780 |
| |
|
Lines changed: 19 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
60 | 76 |
| |
61 |
| - | |
62 |
| - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
63 | 80 |
| |
64 | 81 |
| |
65 | 82 |
| |
|
0 commit comments
Comments
(0)