220 likes | 340 Views
Communication Invariance Based Reduction. GUO Huayang. Overview. Motivation Related work Redundancy analysis. MC in distributed system. Nondeterministic bugs. Thread 1 lock( cs ) x = 0 unlock( cs ) print(x). Thread 2 lock( cs ) x = 1 unlock( cs ). Related work.
E N D
Communication Invariance Based Reduction GUO Huayang
Overview • Motivation • Related work • Redundancy analysis
MC in distributed system • Nondeterministic bugs Thread 1 lock(cs) x = 0 unlock(cs) print(x) Thread 2 lock(cs) x = 1 unlock(cs)
Related work • POR (Partial Order Reduction) • Take meaning of dependency relations • Improvement of basic idea • State Caching y = y + 1 x = x + 1 x = x + 1 y = y + 1
Related work • POR (Partial Order Reduction) • Take meaning of dependency relations • Improvement of basic idea • State Caching x(2), y(1) y = y + 1 x = x + 1 x = x + 1 y = y + 1 x(3), y(2) x(3), y(2)
Related work • POR + State Caching • Fix false dependency relation • Avoid state machine cycle • Large scale system x = x + 2 x = x * 2 x = x * 2 x = x + 2
Process 0 Process 1 confirm ...... ...... 1,000×1,000=1,000,000
Dining Philosophers Problem Execution P1 take right chopstick P1 take left chopstick P1 have dinner P1 put down chopsticks P3 take right chopstick P3 take left chopstick P3 have dinner P3 put down chopsticks P2 take right chopstick P2 take left chopstick P2 have dinner P2 put down chopsticks P4 take right chopstick P4 take left chopstick P4 have dinner P4 put down chopsticks 1 2 4 3
Deadlock Execution P1 take right chopstick P3 take right chopstick P2 take right chopstick P4 take right chopstick Deadlock and starve to death ! 1 2 4 3
Naive Enumeration Execution P1 take right chopstick P1 take left chopstick P3 take right chopstick P1 have dinner P4 take right chopstick P1 put down chopsticks P2 take right chopstick …… 1 2 4 3
Partial Order Reduction • Dependency relations • Taking left/right • Taking right happens first 1 2 Left Right Left Right Left Right Left Right 2n – 1 = 24 – 1 = 15 4 3
Communication Invariance Based Reduction 1 Left Right In philosopher 1’s view Take right. Succeed! Take left.Succeed? Have dinner.Succeed! Put down. Succeed! Only 2 scenarios!
RSL experiments • RSL experiment analysis • 3 replicas (20 different message interfaces) 20,000 executions explored by DPOR 400 necessary executions for a process • 2 replicas (100 different message interfaces) 20,000 executions explored by DPOR 2,500 necessary executions for a process
Advantages • Communication invariance based reduction • A more significant and primary reduction method • Compatible with POR and State Caching
Thanks. Questions are welcome.
Framework • Produce all possible message interfaces • Examine executions may leads to one message interface in a single process
Algorithm Design • Algorithm flow • Initializemi_setby a random execution • while some mi are not explored, for all process • update the process with mi • commit all new message interfaces to mi_set, whichthe process may produce with mi
Advantages • Extend model checkers to large scale systems • Compatible with existent reduction methods
Process 0 Process 1 S + T ? S × T ? ...... ...... S possible execs T possible execs Global Message Interface
Global/Process Execution • Process 1 • Process 2 Thread 3 recv y from p1 lock(cs’) y = y + 2 unlock(cs’) print(y) Thread 4 lock(cs’) y = y * 2 unlock(cs’) Thread 1 lock(cs) x = 0 unlock(cs) send x to p2 Thread 2 lock(cs) x = 1 unlock(cs) Global execution T1 lock T2 lock T1 send (x = 1) T3 recv (y = 1) … Process 2’s execution T3 recv (y = 1) T3 lock T3 print T4 lock