hyrise-v1
hyrise-v1 copied to clipboard
Make Commit Parallel
Currently only one TX can be committed at a time, this should be improved :)
How would you propose to do this? The only problem I see is the synchronization of deletes. So we have to make sure that not two transactions delete the same row. We could use the TID as a lock of a row, so a transaction that wants to delete a row writes its TID in that row instead. The write uses an atomic TestAndSet so that it fails if some other TID is already written in the row...
This would result in the following states of a row:
v.TID | v.BeginCID | v.EndCID | LastCID | Status |
---|---|---|---|---|
-- | Inf | Inf | 12 | Init |
5 | Inf | Inf | 12 | Insert uncommitted |
5 | 13 | Inf | 12 | Insert commit in prog. |
5 | 13 | Inf | 13 | Insert committed |
-- | 13 | Inf | 13 | Insert committed (cleaned up) |
6 | 13 | Inf | 13 | delete uncommited |
6 | 13 | 14 | 13 | delete commit in prog. |
6 | 13 | 14 | 14 | delete committed |
If the TID servers as a row-level lock, how do we handle deadlocks?