bumper sheltering transactions from conflicts
play

Bumper : Sheltering Transactions from Conflicts Nuno Diegues and - PowerPoint PPT Presentation

Bumper : Sheltering Transactions from Conflicts Nuno Diegues and Paolo Romano ndiegues@gsd.inesc-id.pt www.cloudtm.eu Nuno Diegues 1/27 Context: scalability Large-scale systems powered by the cloud computing paradigm Nuno Diegues 2/27


  1. Distributed Time-Warping: rules 1/2 Distributed scalar clock protocol — used to version data 1 ts C orders transactions after dependencies ( read-from ) ◮ In the absence of stale reads, T 2 . ts C = scalar clock 2 before transactions that were missed ◮ Otherwise, serialize before earliest transaction missed ◮ earliest missed T 2 : T 1 . ts C = T 2 . ts C − ǫ read x read y write y T 1 ts = 1 - ε T 3 rw ts = 2 write z T 2 ts = 1 read x write x Nuno Diegues 12/27

  2. Distributed Time-Warping: rules 2/2 When can we not apply this idea? Nuno Diegues 13/27

  3. Distributed Time-Warping: rules 2/2 When can we not apply this idea? Look out for a specific structure Nuno Diegues 13/27

  4. Distributed Time-Warping: rules 2/2 When can we not apply this idea? Look out for a specific structure: write y read x Three transactions connected A B ◮ a triad rw rw T read y write x Nuno Diegues 13/27

  5. Distributed Time-Warping: rules 2/2 When can we not apply this idea? Look out for a specific structure: write y read x Three transactions connected A B ◮ a triad The link between all three rw rw ◮ the pivot Pivot T read y write x Nuno Diegues 13/27

  6. Distributed Time-Warping: rules 2/2 When can we not apply this idea? Look out for a specific structure: Three transactions connected write y read x A B ◮ a triad The link between all three rw rw ◮ the pivot Pivot T Abort if: read y write x ◮ Completes a triad ◮ Whose pivot time-warp commits Nuno Diegues 13/27

  7. Distributed Time-Warping: details read-set read access empty Nuno Diegues 14/27

  8. Distributed Time-Warping: details read-set read access stamp: < ts , tid > Register read operation Nuno Diegues 14/27

  9. Distributed Time-Warping: details read-only read-set transaction stamp: < ts , tid > Abort-free read-only transactions Nuno Diegues 14/27

  10. Distributed Time-Warping: details read-set write-set read write stamp: < ts , tid > stamp: < ts , tid > Consider update transaction: Validate writes and reads Nuno Diegues 14/27

  11. Distributed Time-Warping: details T.start = 9 read-set write-set validate writes may time-warp? stamp: <10, T> stamp: <10, T> Validate writes and reads Nuno Diegues 14/27

  12. Distributed Time-Warping: details T.start = 9 read-set write-set validate writes may time-warp? Yes stamp: <10, T> stamp: < 10 , T> Validate writes and reads Nuno Diegues 14/27

  13. Distributed Time-Warping: details T.start = 9 write-set read-set validate reads may time-warp? Yes need time-warp? stamp: <10, T> stamp: <10, T> Validate writes and reads Nuno Diegues 14/27

  14. Distributed Time-Warping: details T.start = 9 write-set read-set 1 1 validate reads may time-warp? Yes 1 need time-warp? No stamp: <10, T> stamp: <10, T> 1 Validate writes and reads Nuno Diegues 14/27

  15. Distributed Time-Warping: details T.start = 9 read-set write-set 1 1 validate reads may time-warp? Yes 1 need time-warp? Yes stamp: <10, T> stamp: <10, T> 1 2 new version missed! Time-warp commit Nuno Diegues 14/27

  16. Distributed Time-Warping: details T .start = 9 read-set write-set 1 1 may time-warp? No 1 need time-warp? Yes stamp: <10, T> stamp: < 11 , Z > 1 2 Abort condition Nuno Diegues 14/27

  17. Contribution: 2 /2 read z write z T 2 rw rw T 1 read z write z Recall hotspot example Nuno Diegues 15/27

  18. Contribution: 2 /2 read z write z T 2 rw ? rw T 1 read z write z Delayed Actions programming abstraction Nuno Diegues 15/27

  19. Contribution: 2 /2 read z write z T 2 rw ? rw T 1 read z write z Delayed Actions programming abstraction Nuno Diegues 15/27

  20. Contribution: 2 /2 function TPC-C-payment(wID, dID, cID, amount): store .startTransaction() ⊲ load warehouse wID ⊲ load district dID ⊲ load customer cID ⊲ decrement customer balance ⊲ increment customer yield ⊲ update customer credit history ⊲ increment warehouse yield ⊲ increment district yield store .commitTransaction() return Nuno Diegues 15/27

  21. Contribution: 2 /2 function TPC-C-payment(wID, dID, cID, amount): store .startTransaction() ⊲ load warehouse wID ⊲ load district dID ⊲ load customer cID ⊲ decrement customer balance ⊲ increment customer yield ⊲ update customer credit history ⊲ increment warehouse yield — contention hotspot ⊲ increment district yield store .commitTransaction() — restart a lot of work return Nuno Diegues 15/27

  22. Contribution: 2 /2 function TPC-C-payment(wID, dID, cID, amount): store .startTransaction() ... ⊲ lots of stuff String key ← wID + "balanceKey" int amount ← store . read (key) ⊲ does not affect transaction amount ← amount + change store . write (key, amount) ⊲ objective is to increment ... store .commitTransaction() return Nuno Diegues 15/27

  23. Delayed Actions: key idea start T 1 write balance try ... ... ok read commit read balance Server ... ... read abort try balance commit read T 2 write start balance Nuno Diegues 16/27

  24. Delayed Actions: key idea start T 1 write balance try ... ... ok read commit read balance Server ... ... read abort try balance commit read T 2 write start balance Nuno Diegues 16/27

  25. Delayed Actions: key idea start T 1 ... try ok read commit delay T 1 Server delay T 2 ... try ok commit read T 2 start Nuno Diegues 16/27

  26. Contribution 2 /2 Delayed Actions: identify operations processed without conflicts Nuno Diegues 17/27

  27. Contribution 2 /2 Delayed Actions: identify operations ◮ outcome does not affect the transaction processed without conflicts Nuno Diegues 17/27

  28. Contribution 2 /2 Delayed Actions: identify operations ◮ outcome does not affect the transaction ◮ require programmer’s knowledge processed without conflicts Nuno Diegues 17/27

  29. Contribution 2 /2 Delayed Actions: identify operations ◮ outcome does not affect the transaction ◮ require programmer’s knowledge processed without conflicts Nuno Diegues 17/27

  30. Contribution 2 /2 Delayed Actions: identify operations ◮ outcome does not affect the transaction ◮ require programmer’s knowledge processed without conflicts ◮ delayed to commit-time Nuno Diegues 17/27

  31. Contribution 2 /2 Delayed Actions: identify operations ◮ outcome does not affect the transaction ◮ require programmer’s knowledge processed without conflicts ◮ delayed to commit-time ◮ use the latest snapshot Nuno Diegues 17/27

  32. Contribution 2 /2 Delayed Actions: identify operations ◮ outcome does not affect the transaction ◮ require programmer’s knowledge processed without conflicts ◮ delayed to commit-time ◮ use the latest snapshot ◮ ensure it cannot be invalidated Nuno Diegues 17/27

  33. Delayed Actions: details In the commit procedure: Nuno Diegues 18/27

  34. Delayed Actions: details In the commit procedure: acquire locks for delayed actions Nuno Diegues 18/27

  35. Delayed Actions: details In the commit procedure: acquire locks for delayed actions keys were defined by programmer Nuno Diegues 18/27

  36. Delayed Actions: details In the commit procedure: acquire locks for delayed actions keys were defined by programmer ◮ over-approximate for dynamic structures Nuno Diegues 18/27

  37. Delayed Actions: details In the commit procedure: acquire locks for delayed actions keys were defined by programmer ◮ over-approximate for dynamic structures if successful, confirm transaction: Nuno Diegues 18/27

  38. Delayed Actions: details In the commit procedure: acquire locks for delayed actions keys were defined by programmer ◮ over-approximate for dynamic structures if successful, confirm transaction: ◮ atomically execute delayed actions Nuno Diegues 18/27

  39. Delayed Actions: details In the commit procedure: acquire locks for delayed actions keys were defined by programmer ◮ over-approximate for dynamic structures if successful, confirm transaction: ◮ atomically execute delayed actions ◮ write-back deferred updates Nuno Diegues 18/27

  40. Delayed Actions: details In the commit procedure: acquire locks for delayed actions keys were defined by programmer ◮ over-approximate for dynamic structures if successful, confirm transaction: ◮ atomically execute delayed actions ◮ write-back deferred updates ◮ atomicity enforced with sequential confirmation thread per machine Nuno Diegues 18/27

  41. In more detail... Algorithms for Bumper Nuno Diegues 19/27

  42. In more detail... Integration with different Distributed Data Platforms Nuno Diegues 19/27

  43. In more detail... Correctness proofs Nuno Diegues 19/27

  44. In more detail... Fault-tolerance Nuno Diegues 19/27

  45. Experimental Evaluation: questions How much can Bumper enhance scalability in conflict-prone scenarios? Nuno Diegues 20/27

  46. Experimental Evaluation: questions How much can Bumper enhance scalability in conflict-prone scenarios? To what extent can it reduce transactions’ abort rate? Nuno Diegues 20/27

  47. Experimental Evaluation: questions How much can Bumper enhance scalability in conflict-prone scenarios? To what extent can it reduce transactions’ abort rate? What overheads does it introduce? Nuno Diegues 20/27

Recommend


More recommend