james r wilcox zach tatlock ilya sergey distributed
play

` James R. Wilcox Zach Tatlock Ilya Sergey Distributed Systems - PowerPoint PPT Presentation

Programming Language Abstractions for Modularly Verified Distributed Systems { P } c { Q } ` James R. Wilcox Zach Tatlock Ilya Sergey Distributed Systems Distributed Infrastructure Distributed Applications Verified Distributed Systems


  1. Programming Language Abstractions for Modularly Verified Distributed Systems { P } c { Q } ` James R. Wilcox Zach Tatlock Ilya Sergey

  2. Distributed Systems

  3. Distributed Infrastructure

  4. Distributed Applications

  5. Verified Distributed Systems

  6. Verified Distributed Systems

  7. Verified Distributed Infrastructure

  8. Verified Distributed Infrastructure Veri- Wow -Cert Iron

  9. Verified Distributed Applications

  10. Verified Distributed Applications Veri- Wow -Cert Iron

  11. Verified Distributed Applications Veri- Wow Challenging to verify apps in terms of infra. verify clients by starting over! Indicates deeper problems with composition one node’s client is another’s server! -Cert Iron

  12. Challenging to verify apps in terms of infra. Verified Distributed Applications verify clients by starting over! Indicates deeper problems with composition Veri- Wow one node’s client is another’s server! (Make it possible to) verify clients verify clients without starting over! Will also enable more general composition -Cert Iron

  13. Composition: A way to make proofs harder

  14. Composition: A way to make proofs harder When distracting language issues are removed and the underlying mathematics is revealed, compositional reasoning is seen to be of little use.

  15. Approach Distributed Hoare Type Theory ` { P } c { Q }

  16. Distributed Interactions Servers and Clients Combining Services Optimizations Horizons gcc -O3

  17. Cloud Compute 21 C S

  18. Cloud Compute

  19. Cloud Compute

  20. Cloud Compute : Server while True: (from, n) <- recv send (n, factors(n)) to from

  21. Cloud Compute : Server while True: (from, n) <- recv send (n, factors(n)) to from Traditional specification: messages from server have correct factors Proved by finding an invariant of the system

  22. Cloud Compute: Server

  23. Cloud Compute: Client

  24. Cloud Compute: Client send 21 to server (_, ans) <- recv assert ans == {3, 7}

  25. Cloud Compute: Client send 21 to server (_, ans) <- recv assert ans == {3, 7} Expand system to include clients Need to reason about client-server interaction introduce protocol

  26. Protocols

  27. Protocols

  28. Protocols Protocols make it possible to verify clients!

  29. Protocols

  30. Protocols State: abstract state of each node

  31. Protocols State: abstract state of each node Transitions: allowed sends and receives

  32. Cloud Compute Protocol State: Transitions:

  33. Cloud Compute Protocol State: permissions: Set<Msg> Transitions:

  34. Cloud Compute Protocol State: permissions: Set<Msg> Transitions: Send Req Send Resp Recv Req Recv Resp

  35. Cloud Compute: Protocol State: Recv Request n perm: Set<Msg> add (from, n) to perm Effect: Transitions: Send Req Send Resp Recv Req Recv Resp

  36. Cloud Compute: Protocol State: Send Response (n,l) perm: Set<Msg> Requires: l == factors(n) Transitions: (n,to) in perm Send Req Send Resp Effect: Recv Req Recv Resp removes (n,to) from perm

  37. Cloud Compute: Protocol State: Recv Response l perm: Set<Msg> Ensures: l == factors(n) Transitions: (n,to) in perm Send Req Send Resp Recv Req Recv Resp

  38. Cloud Compute: Protocol State: permissions: Set<Msg> Transitions: Send Req Send Resp Recv Req Recv Resp

  39. Cloud Compute: Protocol State: permissions: Set<Msg> Protocols make it possible to verify clients! Transitions: Send Req Send Resp Recv Req Recv Resp

  40. From Protocols to Types ` { P } c { Q }

  41. From Protocols to Types ` { P } { } m h send m to h ( ) sent t ,

  42. From Protocols to Types ` { P } { } m h send m to h ( ) sent t t ,

  43. From Protocols to Types t ∈ ` { P } { } m h send m to h ( ) sent t t ,

  44. From Protocols to Types P ⇒ Pre t t ∈ ` { P } { } m h send m to h ( ) sent t t ,

  45. From Protocols to Types P ⇒ Pre t t ∈ ` { P } { } m h send m to h ( ) sent t t ,

  46. Cloud Compute: Client send 21 to server (_, ans) <- recv assert ans == {3, 7}

  47. Cloud Compute: Client send 21 to server (_, ans) <- recv assert ans == {3, 7} recv ensures correct factors

  48. Cloud Compute: More Clients send 21 to server 1 send 35 to server 2 (_, ans 1 ) <- recv (_, ans 2 ) <- recv assert ans 1 ans 2 == {3, 5, 7} ∪

  49. Cloud Compute: More Clients send 21 to server 1 send 35 to server 2 (_, ans 1 ) <- recv (_, ans 2 ) <- recv assert ans 1 ans 2 == {3, 5, 7} ∪ Same protocol enables verification

  50. Cloud Compute: More Clients send 21 to server 1 send 35 to server 2 (_, ans 1 ) <- recv (_, ans 2 ) <- recv assert ans 1 ans 2 == {3, 5, 7} ∪ Same protocol enables verification

  51. Cloud Compute : Server while True: (from, n) <- recv send (n, factors(n)) to from

  52. Cloud Compute : Server while True: (from, n) <- recv send (n, factors(n)) to from Precondition on send requires correct factors

  53. Cloud Compute : More Servers cache = {} 
 while True: (from, n) <- recv ans = if n cache then cache[n] ∈ else factors(n) cache[n] = ans send (n, ans) to from

  54. Cloud Compute : More Servers cache = {} 
 while True: (from, n) <- recv ans = if n cache then cache[n] ∈ else factors(n) cache[n] = ans send (n, ans) to from Still follows protocol!

  55. Cloud Compute : More Servers while True: (from, n) <- recv send n to backend (_, ans) <- recv send (n, ans) to from

  56. Cloud Compute : More Servers while True: Still follows protocol! (from, n) <- recv send n to backend (_, ans) <- recv send (n, ans) to from

  57. Cloud Compute : More Servers while True: Still follows protocol! (from, n) <- recv send n to backend (_, ans) <- recv send (n, ans) to from Any combination of transitions follows protocol Well-typed programs don’t go wrong! One node’s client is another’s server!

  58. Horizons Sophisticated protocol composition e.g. computation uses separate database Adding other effects e.g. mutable heap, threads, failure… Fault tolerance what do Verdi’s VSTs look like here?

  59. Verified Distributed Applications

  60. Verified Distributed Applications Veri- Wow -Cert Iron

  61. Verified Distributed Applications Veri- Wow Challenging to verify apps in terms of infra. verify clients by starting over! Indicates deeper problems with composition one node’s client is another’s server! -Cert Iron

  62. Challenging to verify apps in terms of infra. Verified Distributed Applications verify clients by starting over! Indicates deeper problems with composition Veri- Wow one node’s client is another’s server! Protocols make it possible to verify clients reason about client-server interaction Also enable more general composition Any combination of transitions follows protocol -Cert Iron Well-typed programs don’t go wrong!

  63. Verified Distributed Applications Protocols make it possible to verify clients reason about client-server interaction Veri- Wow Also enable more general composition Any combination of transitions follows protocol Well-typed programs don’t go wrong! -Cert Iron

  64. Verified Distributed Applications Protocols make it possible to verify clients reason about client-server interaction Veri- Wow Also enable more general composition Any combination of transitions follows protocol Well-typed programs don’t go wrong! Composition is hard but important for infrastructure -Cert Iron Achieve with types syntactic theory of composition

Recommend


More recommend