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

Executing requests concurrently in state machine replication

Executing requests concurrently in state machine replication

Slides of my Ph.D. defence.

Tiago Vale

May 03, 2019
Tweet

More Decks by Tiago Vale

Other Decks in Research

Transcript

  1. Executing requests concurrently in
    state machine replication
    Ph.D. defence
    Tiago Vale
    Advisors: João Lourenço, Ricardo Dias

    View full-size slide

  2. Motivation
    Society increasingly
    dependent on
    computer systems

    View full-size slide

  3. Motivation
    Society increasingly
    dependent on
    computer systems
    Systems operate on
    environments where
    failures happen

    View full-size slide

  4. Motivation
    Society increasingly
    dependent on
    computer systems
    Systems operate on
    environments where
    failures happen
    Systems should
    tolerate faults
    + =

    View full-size slide

  5. Fault tolerance via redundancy

    View full-size slide

  6. Fault tolerance via redundancy

    View full-size slide

  7. Fault tolerance via redundancy

    View full-size slide

  8. Fault tolerance via redundancy
    do_stuff();
    do_stuff();
    do_stuff();
    do_stuff();

    View full-size slide

  9. State machine replication
    Ȑ
    Ȑ
    Ȑ

    View full-size slide

  10. State machine replication
    Ȑ
    Ȑ
    Ȑ

    View full-size slide

  11. State machine replication
    Ȑ
    Ȑ
    Ȑ
    Agreement
    2
    1 3 4

    View full-size slide

  12. State machine replication
    Ȑ
    2
    1 3 4
    Ȑ
    2
    1 3 4
    Ȑ
    2
    1 3 4
    Agreement
    2
    1 3 4

    View full-size slide

  13. Tension
    2
    1 3 4
    Ȑ
       
    vs.

    View full-size slide

  14. Research statement
    Can we scale state machine replication
    on multicore servers
    with minimal impact for application developers?

    View full-size slide

  15. Our approach
    2
    1 3 4
    Ȑ
       

    View full-size slide

  16. Our approach
    2
    1 3 4
    Ȑ
       
    Extract concurrency
    using speculative
    transactions

    View full-size slide

  17. Contributions

    2
    1 3 4
    Ȑ
       
    Preordered transactions
    Extract concurrency
    using speculative
    transactions

    View full-size slide

  18. Contributions

    2
    1 3 4
    Ȑ
       
    Preordered transactions
    Lazy state determination API
    Extract concurrency
    using speculative
    transactions

    View full-size slide

  19. Contributions

    2
    1 3 4
    Ȑ
       
    Preordered transactions
    Lazy state determination API
    Extract concurrency
    using speculative
    transactions

    View full-size slide

  20. Traditional transactions
    2
    1 3 4 5

    View full-size slide

  21. Traditional transactions
    Active
    Serialized
    2
    1 3 4 5

    View full-size slide

  22. Traditional transactions
    Active
    Serialized
    2
    1 3 4 5

    View full-size slide

  23. Traditional transactions
    Active
    Serialized
    2
    1 3 4 5

    View full-size slide

  24. Pot
    Active
    Serialized
    2
    1 3 4 5
    Key observation: speculative
    transactions only modify state
    when they commit.

    View full-size slide

  25. Pot
    Active
    Serialized
    2
    1 3 4 5
    Force transactions to commit
    in the order the replicas
    agreed upon.

    View full-size slide

  26. Pot
    Active
    Serialized
    Active
    Serialized
    2
    1 3 4 5

    View full-size slide

  27. Pot
    Active
    Serialized
    Active
    Serialized
    2
    1 3 4 5
    Key observation: now we
    know which transaction
    commits next.

    View full-size slide

  28. Pot
    Active
    Serialized
    Active
    Serialized
    2
    1 3 4 5
    Execute it in a fast mode that
    bypasses speculation.

    View full-size slide

  29. Pot
    Active
    Serialized
    2
    1 3 4 5
    Active
    Serialized
    2
    1 3 4 5

    View full-size slide

  30. Pot
    Active
    Serialized
    Active
    Serialized
    2
    1 3 4 5
    If consecutive transactions
    commute, Pot can execute
    them as fast simultaneously.

    View full-size slide

  31. TPC-C w/ 32 warehouse (low contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Traditional SMR Fault-prone Pot Pot (multiple fast)

    View full-size slide

  32. TPC-C w/ 32 warehouse (low contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Traditional SMR Fault-prone Pot Pot (multiple fast)

    View full-size slide

  33. TPC-C w/ 32 warehouse (low contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Traditional SMR Fault-prone Pot Pot (multiple fast)

    View full-size slide

  34. TPC-C w/ 32 warehouse (low contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Traditional SMR Fault-prone Pot Pot (multiple fast)

    View full-size slide

  35. TPC-C w/ 32 warehouse (low contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Traditional SMR Fault-prone Pot Pot (multiple fast)
    ~2x

    View full-size slide

  36. TPC-C w/ 32 warehouse (low contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Traditional SMR Fault-prone Pot Pot (multiple fast)
    ~4x

    View full-size slide

  37. TPC-C w/ 32 warehouse (low contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Traditional SMR Fault-prone Pot Pot (multiple fast)

    View full-size slide

  38. TPC-C w/ 32 warehouse (low contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Traditional SMR Fault-prone Pot Pot (multiple fast)
    ~1.3x

    View full-size slide

  39. TPC-C w/ 32 warehouse (low contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Traditional SMR Fault-prone Pot Pot (multiple fast)
    ~1.5x

    View full-size slide

  40. TPC-C w/ 1 warehouse (high contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Traditional SMR Fault-prone Pot

    View full-size slide

  41. TPC-C w/ 1 warehouse (high contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Traditional SMR Fault-prone Pot

    View full-size slide

  42. TPC-C w/ 1 warehouse (high contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Traditional SMR Fault-prone Pot

    View full-size slide

  43. TPC-C w/ 1 warehouse (high contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Traditional SMR Fault-prone Pot

    View full-size slide

  44. TPC-C w/ 1 warehouse (high contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Traditional SMR Fault-prone Pot
    ~4x

    View full-size slide

  45. TPC-C w/ 1 warehouse (high contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Traditional SMR Fault-prone Pot

    View full-size slide

  46. Contributions

    2
    1 3 4
    Ȑ
       
    Preordered transactions
    Lazy state determination API

    View full-size slide

  47. Traditional API
    begin

    [=42] v ← read(stock)
    if v > 0:
    v ← v - 1
    [→41] write(stock, v)

    commit

    View full-size slide

  48. Traditional API
    begin

    [=42] v ← read(stock)
    if v > 0:
    v ← v - 1
    [→41] write(stock, v)

    commit

    View full-size slide

  49. LSD API
    begin

    [=42] v ← read(stock)
    if v > 0:
    v ← v - 1
    [→41] write(stock, v)

    commit
    begin

    [>0] if is-true({? > 0}):
    f ← {? - 1}
    [→?-1] write(stock, f)

    commit
    Key observation: transaction
    does not need to observe a
    concrete state to execute its
    logic.

    View full-size slide

  50. LSD API
    begin

    [=42] v ← read(stock)
    if v > 0:
    v ← v - 1
    [→41] write(stock, v)

    commit
    begin

    ? ← read(stock)
    [>0] if is-true({? > 0}):
    f ← {? - 1}
    [→?-1] write(stock, f)

    commit
    Obtain a future that
    represents the stock value
    instead of the concrete stock
    value as of right now.

    View full-size slide

  51. LSD API
    begin

    [=42] v ← read(stock)
    if v > 0:
    v ← v - 1
    [→41] write(stock, v)

    commit
    begin

    ? ← read(stock)
    [>0] if is-true({? > 0}):
    f ← {? - 1}
    [→?-1] write(stock, f)

    commit

    View full-size slide

  52. LSD API
    begin

    [=42] v ← read(stock)
    if v > 0:
    v ← v - 1
    [→41] write(stock, v)

    commit
    begin

    ? ← read(stock)
    [>0] if is-true({? > 0}):
    f ← {? - 1}
    [→?-1] write(stock, f)

    commit
    Key observation: transaction
    can know whether the
    predicate is true without
    observing a concrete value.

    View full-size slide

  53. LSD API
    begin

    [=42] v ← read(stock)
    if v > 0:
    v ← v - 1
    [→41] write(stock, v)

    commit
    begin

    ? ← read(stock)
    [>0] if is-true({? > 0}):
    f ← {? - 1}
    [→?-1] write(stock, f)

    commit

    View full-size slide

  54. LSD API
    begin

    [=42] v ← read(stock)
    if v > 0:
    v ← v - 1
    [→41] write(stock, v)

    commit
    begin

    ? ← read(stock)
    [>0] if is-true({? > 0}):
    f ← {? - 1}
    [→?-1] write(stock, f)

    commit
    New operation to execute
    predicates over futures.

    View full-size slide

  55. LSD API
    begin

    [=42] v ← read(stock)
    if v > 0:
    v ← v - 1
    [→41] write(stock, v)

    commit
    begin

    ? ← read(stock)
    [>0] if is-true({? > 0}):
    f ← {? - 1}
    [→?-1] write(stock, f)

    commit

    View full-size slide

  56. LSD API
    begin

    [=42] v ← read(stock)
    if v > 0:
    v ← v - 1
    [→41] write(stock, v)

    commit
    begin

    ? ← read(stock)
    [>0] if is-true({? > 0}):
    f ← {? - 1}
    [→?-1] write(stock, f)

    commit
    Key observation: transaction
    can specify how to compute
    the new value.

    View full-size slide

  57. LSD API
    begin

    [=42] v ← read(stock)
    if v > 0:
    v ← v - 1
    [→41] write(stock, v)

    commit
    begin

    ? ← read(stock)
    [>0] if is-true({? > 0}):
    f ← {? - 1}
    [→?-1] write(stock, f)

    commit
    Function that computes the
    new value based on futures.

    View full-size slide

  58. LSD API
    begin

    [=42] v ← read(stock)
    if v > 0:
    v ← v - 1
    [→41] write(stock, v)

    commit
    begin

    ? ← read(stock)
    [>0] if is-true({? > 0}):
    f ← {? - 1}
    [→?-1] write(stock, f)

    commit
    Execute f when transaction
    commits and ? is resolved to a
    concrete value.

    View full-size slide

  59. TPC-C w/ 1 warehouse (high contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Traditional SMR Fault-prone Pot Pot+LSD

    View full-size slide

  60. TPC-C w/ 1 warehouse (high contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Traditional SMR Fault-prone Pot Pot+LSD

    View full-size slide

  61. TPC-C w/ 1 warehouse (high contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Traditional SMR Fault-prone Pot Pot+LSD
    ~1.3x

    View full-size slide

  62. TPC-C w/ 1 warehouse (high contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Traditional SMR Fault-prone Pot Pot+LSD
    ~3x

    View full-size slide

  63. Conclusion
    •Scale state machine replication on multicore
    servers with minimal impact for application
    developers
    •Pot guarantees correctness
    •LSD improves efficiency

    View full-size slide

  64. Thank you for your time.

    View full-size slide

  65. Executing requests concurrently in
    state machine replication
    Ph.D. defence
    Tiago Vale
    Advisors: João Lourenço, Ricardo Dias

    View full-size slide

  66. TPC-C w/ 32 warehouse (low contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Sequential 2PL OCC Pot Pot (multiple fast)

    View full-size slide

  67. TPC-C w/ 1 warehouse (high contention)
    Successful transactions/second
    0K
    2,5K
    5K
    7,5K
    10K
    12,5K
    15K
    17,5K
    20K
    22,5K
    Number of clients
    1 2 4 8 16 32 48 64 80
    Sequential 2PL OCC Pot Pot+LSD

    View full-size slide