1 / 45

Elastic Transactions

Elastic Transactions. Pascal Felber Vincent Gramoli Rachid Guerraoui. Regular Transactions. Set implementation w/ sorted linked list (x < y < z). t. h. y. Regular Transactions. Set implementation w/ sorted linked list (x < y < z). t. h. y. insert (z) insert(x). BEGIN_TX R(h)

Download Presentation

Elastic Transactions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Elastic Transactions Pascal Felber Vincent Gramoli Rachid Guerraoui

  2. Regular Transactions Set implementation w/ sorted linked list (x < y < z) t h y

  3. Regular Transactions Set implementation w/ sorted linked list (x < y < z) t h y insert(z) insert(x) BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX

  4. Regular Transactions Set implementation w/ sorted linked list (x < y < z) t h y insert(z) insert(x) BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX

  5. Regular Transactions Set implementation w/ sorted linked list (x < y < z) t h x y insert(z) insert(x) BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX

  6. Regular Transactions Set implementation w/ sorted linked list (x < y < z) t h x y insert(z) insert(x) BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX

  7. Regular Transactions Set implementation w/ sorted linked list (x < y < z) t h x y z insert(z) insert(x) BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX

  8. Regular Transactions Set implementation w/ sorted linked list (x < y < z) t h x y z insert(z) insert(x) BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX

  9. Regular Transactions Set implementation w/ sorted linked list (x < y < z) t h x y z insert(z) insert(x) BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX Both transactions DO NOT commit…

  10. Regular Transactions Set implementation w/ sorted linked list (x < y < z) t h x y z insert(z) insert(x) BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX None of these accesses depend on the execution of the other …but both transactions COULD commit.

  11. Large Data Structures Linked list Integer set 216 elements in avg.

  12. Large Data Structures Linked list Integer set 216 elements in avg. 8-core Intel Xeon 1 operation / tx TinySTM (most efficient on μ-benchs AFAWK)

  13. Static Cut Set implementation w/ sorted linked list

  14. Static Cut Set implementation w/ sorted linked list insert(z) insert(x) BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX

  15. Static Cut Set implementation w/ sorted linked list insert(z) insert(x) BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX Cut here

  16. Static Cut Set implementation w/ sorted linked list insert(z) insert(x) insert(z) BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX BEGIN_TX R(h) R(y) R(t) W(y) END_TX

  17. Static Cut Set implementation w/ sorted linked list insert(z) insert(x) insert(z) BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX BEGIN_TX R(h) R(y) R(t) W(y) END_TX Lost update issue [Valois 95]

  18. Elastic Transactions • An elastic transaction adjusts its size dynamically by cutting it into subsequences of accesses at runtime. • The library programmer must use BEGIN_EL_TX to differentiate elastic and normal transactions. • The application programmer does not have to care about whether elastic transactions are used.

  19. Elastic Transaction Improvement Without With

  20. Elastic Transaction Improvement Without With

  21. Elastic Transaction Improvement Without With

  22. Elastic Transaction Improvement Without With

  23. How do elastic transactions work? Key Idea: Cutting transactions dynamically insert(z) BEGIN_TX R(h) R(y) R(t) W(y) END_TX May I cut the tx here?

  24. How do elastic transactions work? Key Idea: Cutting transactions dynamically insert(z) insert(x) BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX Yes!

  25. How do elastic transactions work? Key Idea: Cutting transactions dynamically insert(z) insert(x) insert(z) BEGIN_TX R(h) R(y) R(t) W(y) END_TX BEGIN_TX R(h) R(y) W(h) END_TX BEGIN_TX R(h) R(y) R(t) W(y) END_TX No!

  26. How do elastic transactions work? Key Idea: Cutting transactions dynamically insert(z) insert(x) insert(z) BEGIN_TX R(h) R(y) ABORT END_TX BEGIN_TX R(h) R(y) W(h) END_TX BEGIN_TX R(h) R(y) R(t) W(y) END_TX The elastic transaction aborts if there is no way to cut

  27. How is a cut achieved? BEGIN_EL_TX R(*) R(*) R(*) R(*) R(*) R(*) W(*) W(*) W(*) END_TX A cut of an elastic transaction e is well-formed if :

  28. How is a cut achieved? BEGIN_EL_TX R(*) R(*) R(*) R(*) R(*) R(*) W(*) W(*) W(*) END_TX A cut of an elastic transaction e is well-formed if : • all subsequences contain at least 2 operations

  29. How is a cut achieved? BEGIN_EL_TX R(*) R(*) R(*) R(*) R(*) R(*) W(*) W(*) W(*) END_TX A cut of an elastic transaction e is well-formed if : • all subsequences contain at least 2 operations • all writes of e belong to the same sub-sequence

  30. How is a cut achieved? BEGIN_EL_TX R(*) R(*) R(*) R(*) R(*) R(*) W(*) W(*) W(*) END_TX A cut of an elastic transaction e is well-formed if : • all subsequences contain at least 2 operations • all writes of e belong to the same sub-sequence • all sub-sequences start with a read (unless e starts writing)

  31. How is a cut achieved? A cut of an elastic transaction e is consistent if all common elements accessed by two consecutive sub-sequences are not written.

  32. How is a cut achieved? A cut of an elastic transaction e is consistent if all common elements accessed by two consecutive sub-sequences are not written. • This avoids: R(x) R(y) W(x) W(y) NO R(x) R(x) W(x) NO

  33. How is a cut achieved? A cut of an elastic transaction e is consistent if all common elements accessed by two consecutive sub-sequences are not written. • This avoids: • This allows: R(x) R(y) W(x) W(y) NO R(x) R(x) W(x) NO R(x) R(y) W(x) OK R(x) R(y) W(y) OK

  34. Elastic Guarantees Elastic-opacity: A history is elastic-opaque if there are consistent cuts such that replacing each elastic tx e by its resulting subsequences form an opaque history.

  35. Elastic Transaction Guarantees Elastic transactions: weaker than regular ones delete(q) delete(q) BEGIN_TX R(h) R(a) R(b) … W(z) END_TX BEGIN_EL_TX R(h) R(a) R(b) … W(z) END_TX Cut

  36. Is there a limitation? • Elastic tx apply to most common operations • In linked lists, skip lists, hash tables, red-black trees… • Elastic tx apply to most common operations • Ex:delete(*)/search(*)/insert(*)/move(*,*)… • Elastic tx do not apply to complex operations • sumAll() • conditionalWrite() t h x y z

  37. No! • For complex operations, use regular transactions • Both type of transactions combine safely sumAll() / conditionalWrite() t h x y z search(z) sumAll() BEGIN_EL_TX R(h) R(x) R(y) R(z) END_TX BEGIN_RL_TX R(h) R(x) R(y) R(z) R(t) END_TX

  38. Related Work • Fine-grained locking: Efficient parsing of data structure • Early release: Some reads may be forgotten (release() method) • Commutative operations: High-level commutative ops do not conflict • Boosting / Open nesting: Take effect before commit-time • Abstract nesting: Partial roll-back mechanism

  39. Related Work • Fine-grained locking: Efficient parsing of data structure Does not support composition • Early release: Some reads may be forgotten (release() method) Programmer must know when and what to release • Commutative operations: High-level commutative ops do not conflict Static identification of commutative operations is too restrictive • Boosting / Open nesting: Take effect before commit-time Complex roll-back mechanism must be defined • Abstract nesting: Partial roll-back mechanism Minimize abort costs, not the amount of unnecessary aborts

  40. Conclusion • Elastic transaction New transactional model

  41. Conclusion • Elastic transaction New transactional model • Easy-to-use Use BEGIN_EL_TX and END as delimiters in sequential code

  42. Conclusion • Elastic transaction New transactional model • Easy-to-use Use BEGIN_EL_TX and END as delimiters in sequential code • Composable Elastic and regular transactions are composable

  43. Conclusion • Elastic transaction New transactional model • Easy-to-use Use BEGIN_EL_TX and END as delimiters in sequential code • Composable Elastic and regular transactions are composable • Efficient Speedup frequently executed operations

  44. Conclusion • Elastic transaction New transactional model • Easy-to-use Use BEGIN_EL_TX and END as delimiters in sequential code • Composable Elastic and regular transactions are composable • Efficient Speedup frequently executed operations • Future work Characterize the requirements to use elastic transactions

  45. Thank you http://lpd.epfl.ch/gramoli/php/estm.php

More Related