Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Potential Dangers of Causal Consistency and an Explicit Solution

pbailis
October 12, 2012

The Potential Dangers of Causal Consistency and an Explicit Solution

pbailis

October 12, 2012
Tweet

More Decks by pbailis

Other Decks in Technology

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

    View Slide

  2. A Story

    View Slide

  3. A Story

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  23. View Slide

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

    View Slide

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

    View Slide

  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

    View Slide

  27. 2011-12

    View Slide

  28. 2011-12

    View Slide

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

    View Slide

  30. 2011-12
    IEEE CAP SOSP: COPS
    There are
    many hard,
    trade-offs,
    but
    causal
    consistency
    can work
    well

    View Slide

  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*!

    View Slide

  32. View Slide

  33. “Sally’s
    okay!”

    View Slide

  34. “Sally’s
    okay!”

    View Slide

  35. “Sally’s
    okay!”

    View Slide

  36. “Sally’s
    okay!”

    View Slide

  37. “Sally’s
    okay!”

    View Slide

  38. “Sally’s
    okay!”

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  43. View Slide

  44. View Slide

  45. View Slide

  46. Deliver writes
    in the “right”
    order

    View Slide

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

    View Slide

  48. Causal Consistency
    reads obey partial order
    called “happens-before”

    View Slide

  49. View Slide

  50. View Slide

  51. View Slide

  52. View Slide

  53. View Slide

  54. View Slide

  55. View Slide

  56. View Slide

  57. View Slide

  58. Write value

    View Slide

  59. Write value
    Happens-before
    metadata

    View Slide

  60. Write value
    Happens-before
    metadata

    View Slide

  61. View Slide

  62. View Slide

  63. View Slide

  64. Have we seen all
    dependencies?

    View Slide

  65. Have we seen all
    dependencies?

    View Slide

  66. Have we seen all
    dependencies?
    Y

    View Slide

  67. Have we seen all
    dependencies?

    View Slide

  68. Have we seen all
    dependencies?
    Y

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  72. Sounds great, right?

    View Slide

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

    View Slide

  74. Causal Consistency
    reads obey partial order
    called “happens-before”

    View Slide

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

    View Slide

  76. If you wish to make an
    apple pie from scratch,
    you must first invent
    the universe.
    -Carl Sagan

    View Slide

  77. View Slide

  78. “Great
    news!”

    View Slide

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

    View Slide

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

    View Slide

  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?

    View Slide

  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?

    View Slide

  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?

    View Slide

  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?

    View Slide

  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?

    View Slide

  86. Twitter.com
    20 Tweets
    at login
    20 more
    auto-scroll
    600+ per min

    View Slide

  87. Twitter.com
    quickly
    approaches
    asymptotic limit

    View Slide

  88. r
    e
    c
    a
    p

    View Slide

  89. potential danger
    Potential causality graphs are huge,
    limiting local apply rates and throughput
    r
    e
    c
    a
    p

    View Slide

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

    View Slide

  91. View Slide

  92. View Slide

  93. View Slide

  94. View Slide

  95. View Slide

  96. DANGER!
    DANGER!
    DANGER!
    DANGER!
    DANGER!
    DANGER!
    DANGER!
    DANGER!

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  101. DANGER!
    DANGER!
    DANGER!
    DANGER!
    DANGER!
    DANGER!
    DANGER!
    DANGER!
    Adding DCs doesn’t help
    slowest site
    Sustained throughput
    limited to slowest DC

    View Slide

  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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  108. r
    e
    c
    a
    p

    View Slide

  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

    View Slide

  110. Potential dangers spell trouble for causality
    bad news

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  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...

    View Slide

  119. Explicit Matters

    View Slide

  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]

    View Slide

  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

    View Slide

  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

    View Slide

  123. Explicit API
    put(key, value)

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  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

    View Slide

  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

    View Slide

  131. NATURAL EXTENSION
    NOT ROCKET SCIENCE

    View Slide

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

    View Slide

  133. View Slide

  134. potential
    causality

    View Slide

  135. View Slide

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

    View Slide

  137. View Slide

  138. View Slide

  139. A WORLD OF
    HUGE SCALE
    MASSIVE
    INTERACTIVITY
    PLANET-WIDE
    NETWORKS
    REAL-WORLD
    INTERFACES
    UBICOMP
    BIG DATA

    View Slide

  140. View Slide

  141. potential
    dangers

    View Slide

  142. potential
    dangers
    huge causality graphs

    View Slide

  143. potential
    dangers
    huge causality graphs
    throughput scalability limited

    View Slide

  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

    View Slide