The Potential Dangers of Causal Consistency and an Explicit Solution

B7dc26518988058faa50712248c80bd3?s=47 pbailis
October 12, 2012

The Potential Dangers of Causal Consistency and an Explicit Solution

B7dc26518988058faa50712248c80bd3?s=128

pbailis

October 12, 2012
Tweet

Transcript

  1. the potential dangers of causal consistency and an explicit solution

    Peter Bailis, Alan Fekete, Ali Ghodsi, Joseph M. Hellerstein, Ion Stoica SOCC 2012
  2. A Story

  3. A Story

  4. “Sally’s in a coma!” A Story

  5. “Sally’s in a coma!” “Sally’s in a coma!” A Story

    “Sally’s okay!”
  6. “Sally’s in a coma!” “Sally’s in a coma!” A Story

    “Sally’s okay!”
  7. “Sally’s in a coma!” “Sally’s in a coma!” A Story

    “Great news!” “Sally’s okay!”
  8. “Sally’s in a coma!” “Sally’s in a coma!” A Story

    “Great news!” “Sally’s okay!”
  9. “Sally’s in a coma!” “Sally’s in a coma!” “Great news!”

    “Sally’s okay!” The Wrong Story
  10. “Sally’s in a coma!” “Great news!” The Wrong Story

  11. “Sally’s in a coma!” “Great news!” The Wrong Story

  12. “Sally’s in a coma!” “Great news!” The Wrong Story

  13. “Sally’s in a coma!” “Great news!” The Wrong Story ???

  14. The Right Order “Sally’s in a coma!” “Great news!” “Sally’s

    okay!”
  15. The Right Order “Sally’s in a coma!” “Great news!” “Sally’s

    okay!”
  16. The Right Order “Sally’s in a coma!” “Great news!” “Sally’s

    okay!”
  17. SOME DEPENDENCIES METADATA AND MODERN SERVICES (NOT) SCALING UP AND

    OUT BETTER LIVING VIA APP CONTEXT
  18. SOME DEPENDENCIES METADATA AND MODERN SERVICES (NOT) SCALING UP AND

    OUT BETTER LIVING VIA APP CONTEXT
  19. SOME DEPENDENCIES METADATA AND MODERN SERVICES (NOT) SCALING UP AND

    OUT BETTER LIVING VIA APP CONTEXT
  20. SOME DEPENDENCIES METADATA AND MODERN SERVICES (NOT) SCALING UP AND

    OUT BETTER LIVING VIA APP CONTEXT
  21. SOME DEPENDENCIES METADATA AND MODERN SERVICES (NOT) SCALING UP AND

    OUT BETTER LIVING VIA APP CONTEXT
  22. SOME DEPENDENCIES METADATA AND MODERN SERVICES (NOT) SCALING UP AND

    OUT BETTER LIVING VIA APP CONTEXT
  23. None
  24. 1978 “Time, Clocks, and the Ordering of Events in a

    Distributed System” by Leslie Lamport
  25. 1978 “Time, Clocks, and the Ordering of Events in a

    Distributed System” by Leslie Lamport 1994 “Causal Memory” by Ahamad et al.
  26. 1978 “Time, Clocks, and the Ordering of Events in a

    Distributed System” by Leslie Lamport 1994 “Causal Memory” by Ahamad et al. 2011-12
  27. 2011-12

  28. 2011-12

  29. 2011-12 IEEE CAP There are many hard, trade-offs,

  30. 2011-12 IEEE CAP SOSP: COPS There are many hard, trade-offs,

    but causal consistency can work well
  31. 2011-12 IEEE CAP SOSP: COPS Texas: CAC There are many

    hard, trade-offs, but causal consistency can work well and it’s the best you can do*!
  32. None
  33. “Sally’s okay!”

  34. “Sally’s okay!”

  35. “Sally’s okay!”

  36. “Sally’s okay!”

  37. “Sally’s okay!”

  38. “Sally’s okay!”

  39. “Great news!” “Sally’s okay!”

  40. “Great news!” “Sally’s okay!”

  41. “Great news!” “Sally’s okay!”

  42. “Great news!” “Sally’s okay!”

  43. None
  44. None
  45. None
  46. Deliver writes in the “right” order

  47. Deliver writes in the “right” order “Great news!” “Sally’s okay!”

    “Sally’s in a coma!”
  48. Causal Consistency reads obey partial order called “happens-before”

  49. None
  50. None
  51. None
  52. None
  53. None
  54. None
  55. None
  56. None
  57. None
  58. Write value

  59. Write value Happens-before metadata

  60. Write value Happens-before metadata

  61. None
  62. None
  63. None
  64. Have we seen all dependencies?

  65. Have we seen all dependencies?

  66. Have we seen all dependencies? Y

  67. Have we seen all dependencies?

  68. Have we seen all dependencies? Y

  69. Have we seen all dependencies? Yes: apply write

  70. Have we seen all dependencies? Yes: apply write

  71. Have we seen all dependencies? No: wait Yes: apply write

  72. Sounds great, right?

  73. SOME DEPENDENCIES METADATA AND MODERN SERVICES (NOT) SCALING UP AND

    OUT BETTER LIVING VIA APP CONTEXT
  74. Causal Consistency reads obey partial order called “happens-before”

  75. Causal Consistency traditional happens-before: potential causality reads obey partial order

    called “happens-before”
  76. If you wish to make an apple pie from scratch,

    you must first invent the universe. -Carl Sagan
  77. None
  78. “Great news!”

  79. “Great news!” “Sally’s okay!”

  80. “Great news!” “Sally’s okay!” “Great picture!” “Rad party!” “Lol!” “Can’t

    wait for SOCC!” “Want to go skiing?”
  81. “Great news!” “Sally’s okay!” “Great picture!” “Rad party!” “Lol!” “Can’t

    wait for SOCC!” “Want to go skiing?” “I hope my paper gets in.” “You who?” “I love Tahoe!” “Coming tonight?
  82. “Great news!” “Sally’s okay!” “Great picture!” “Rad party!” “Lol!” “Can’t

    wait for SOCC!” “Want to go skiing?” “Snow rocks!” “I hear the PC is great!” “You.” “Hello, “I hope my paper gets in.” “You who?” “I love Tahoe!” “Coming tonight?
  83. “Great news!” “Sally’s okay!” “Great picture!” “Rad party!” “Lol!” “Can’t

    wait for SOCC!” “Want to go skiing?” “Snow rocks!” “I hear the PC is great!” “You.” “Hello, “Who’s there?” “Are you submitting?” “Have you met Larry?” “Great food here” “I hope my paper gets in.” “You who?” “I love Tahoe!” “Coming tonight?
  84. “Great news!” “Sally’s okay!” “Great picture!” “Rad party!” “Lol!” “Can’t

    wait for SOCC!” “Want to go skiing?” “Snow rocks!” “I hear the PC is great!” “You.” “Hello, “Who’s there?” “Are you submitting?” “Have you met Larry?” “Great food here” “Knock, knock.” “I hope my paper gets in.” “You who?” “I love Tahoe!” “Coming tonight?
  85. “Great news!” “Sally’s okay!” “Great picture!” “Rad party!” “Lol!” “Can’t

    wait for SOCC!” “Want to go skiing?” “Snow rocks!” “I hear the PC is great!” “You.” “Hello, “Who’s there?” “Are you submitting?” “Have you met Larry?” “Great food here” “Knock, knock.” “I hope my paper gets in.” “You who?” “I love Tahoe!” “Coming tonight?
  86. Twitter.com 20 Tweets at login 20 more auto-scroll 600+ per

    min
  87. Twitter.com quickly approaches asymptotic limit

  88. r e c a p

  89. potential danger Potential causality graphs are huge, limiting local apply

    rates and throughput r e c a p
  90. SOME DEPENDENCIES METADATA AND MODERN SERVICES (NOT) SCALING UP AND

    OUT BETTER LIVING VIA APP CONTEXT
  91. None
  92. None
  93. None
  94. None
  95. None
  96. DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER!

  97. DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! Unstable queue!

  98. DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! Unstable queue!

    Sustained throughput limited to slowest DC
  99. DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! Unstable queue!

    Sustained throughput limited to slowest DC
  100. DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! Sustained throughput

    limited to slowest DC
  101. DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! Adding DCs

    doesn’t help slowest site Sustained throughput limited to slowest DC
  102. DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! During partitions/failures,

    sustainable throughput is zero writes/s zero Sustained throughput limited to slowest DC
  103. DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! During partitions/failures,

    sustainable throughput is zero writes/s zero
  104. DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! During partitions/failures,

    sustainable throughput is zero writes/s zero
  105. DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! During partitions/failures,

    sustainable throughput is zero writes/s zero Metadata garbage collection stalls stalls
  106. DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! During partitions/failures,

    sustainable throughput is zero writes/s zero Metadata garbage collection stalls stalls
  107. DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! DANGER! During partitions/failures,

    sustainable throughput is zero writes/s zero Metadata garbage collection stalls stalls
  108. r e c a p

  109. r e c a p potential danger Write throughput limited

    to slowest DC Violation 㱺 arbitrarily high visibility latency Adding DCs does not increase throughput
  110. Potential dangers spell trouble for causality bad news

  111. Potential dangers spell trouble for causality to it? Are live

    without we destined bad news
  112. Potential dangers spell trouble for causality to it? Are live

    without we destined bad news
  113. SOME DEPENDENCIES METADATA AND MODERN SERVICES (NOT) SCALING UP AND

    OUT BETTER LIVING VIA APP CONTEXT
  114. Observation Why track dependencies that don’t matter?

  115. Observation Why track dependencies that don’t matter?

  116. Observation Why track dependencies that don’t matter? Need to know

    application semantics
  117. Explicit Causality app-defined “happens-before” transitivity enforced subset of potential causality

  118. Explicit Causality app-defined “happens-before” transitivity enforced subset of potential causality

    not a new idea (e.g., Cheriton and Skeen SOSP 1993, Ladin et al. PODC 1990) but...
  119. Explicit Matters

  120. Explicit Matters Twitter 28% of Tweets in conversations 69% of

    convos are depth two average depth is 10.7 [Ye and Wu SocInfo 2010, Ritter et al. HLT 2010]
  121. Explicit Matters Twitter 28% of Tweets in conversations 69% of

    convos are depth two average depth is 10.7 [Ye and Wu SocInfo 2010, Ritter et al. HLT 2010] reply-to degree and depth are limited
  122. Explicit Matters Twitter 28% of Tweets in conversations 69% of

    convos are depth two average depth is 10.7 [Ye and Wu SocInfo 2010, Ritter et al. HLT 2010] reply-to degree and depth are limited 109 smaller graph for a year of Tweets
  123. Explicit API put(key, value)

  124. put_after(key, value, deps) Explicit API

  125. put_after(key, value, deps) Explicit API

  126. put_after(key, value, deps) Explicit API (possibly empty) set of references

    to other writes
  127. put_after(key, value, deps) Explicit API track what matters (possibly empty)

    set of references to other writes
  128. put_after(key, value, deps) Explicit API track what matters frequently in

    data model already (possibly empty) set of references to other writes
  129. put_after(key, value, deps) Explicit API track what matters frequently in

    data model already can simulate fencing (possibly empty) set of references to other writes
  130. put_after(key, value, deps) Explicit API track what matters frequently in

    data model already can simulate fencing (possibly empty) set of references to other writes won’t track non-explicit references
  131. NATURAL EXTENSION NOT ROCKET SCIENCE

  132. NATURAL EXTENSION NOT ROCKET SCIENCE http://twitter.com/rbranson/status/256795094387142657

  133. None
  134. potential causality

  135. None
  136. A WORLD OF PHYSICAL OPERATIONS MESSAGES REGISTERS READS WRITES MODEST

    SCALE
  137. None
  138. None
  139. A WORLD OF HUGE SCALE MASSIVE INTERACTIVITY PLANET-WIDE NETWORKS REAL-WORLD

    INTERFACES UBICOMP BIG DATA
  140. None
  141. potential dangers

  142. potential dangers huge causality graphs

  143. potential dangers huge causality graphs throughput scalability limited

  144. potential dangers huge causality graphs explicit causality semantic context to

    the rescue consider modern apps helps with #1, indirectly with #2 throughput scalability limited