Mining Temporal Invariants from Partially Ordered Logs
Ivan Beschastnikh Yuriy Brun Michael D. Ernst Arvind Krishnamurthy Thomas E. Anderson
University of Washington
Mining Temporal Invariants from Partially Ordered Logs Ivan - - PowerPoint PPT Presentation
Mining Temporal Invariants from Partially Ordered Logs Ivan Beschastnikh Yuriy Brun University of Washington Michael D. Ernst Arvind Krishnamurthy Thomas E. Anderson Motivating question I am a developer. Why does my system behave in a
Ivan Beschastnikh Yuriy Brun Michael D. Ernst Arvind Krishnamurthy Thomas E. Anderson
University of Washington
2
A tool that mines FSM models from logs
3
propose commit tx-commit tx-abort abort commit abort
4
commonplace (Hadoop, Ajax, Multicore)
sequential, but not concurrent systems
5
commonplace (Hadoop, Ajax, Multicore)
sequential, but not concurrent systems
5
invariants between events
6
concurrent executions
invariants
7
8
T1 T2 Logger Log file
1 a 2 b
a
b
9
a b
T1 T2
a b
T1 T2
a b
T1 T2
T1 T2 Logger Log file
1 a 2 b
a
b
Which of these three systems generated the log?
10
a b
T1 T2
a b
T1 T2
a b
T1 T2
T1 T2 Logger Log file
1 a 2 b
a
b
11
[1,0] a [0,1] b
a b
T1 T2
a b
T1 T2
a b
T1 T2
[1,0] a [1,1] b [1,1] a [0,1] b
buys a ticket
12
Server Client 0 Client 1 Tickets DB
13
[1,0,0] client 0: search for tickets to Portugal for 23/10/11 [0,1,0] client 1: search for tickets to Portugal for 23/10/11 [1,0,1] server: there is a ticket available for 505P [1,1,2] server: there is a ticket available for 505P [2,0,1] client 0: buy ticket [2,1,3] server: sold [1,2,2] client 1: buy ticket [2,2,4] server: tickets sold out buy search search available sold sold-out available buy client 0 client 1 server
Partially ordered log : Execution:
13
Partially ordered log :
buy search search available sold-out sold available buy client 0 client 1 server buy search search available sold sold-out available buy client 0 client 1 server buy search search available sold sold-out available buy client 0 client 1 server search search available available client 0 client 1 server search sold available client 0 client 1 server buy search sold-out [1,0,0] client 0: search for tickets to Portugal for 23/10/11 [0,1,0] client 1: search for tickets to Portugal for 23/10/11 [1,0,1] server: there is a ticket available for 505P [1,1,2] server: there is a ticket available for 505P [2,0,1] client 0: buy ticket [2,1,3] server: sold [1,2,2] client 1: buy ticket [2,2,4] server: tickets sold out [0,1,0] client 1: search for tickets to Portugal for 23/10/11 [1,0,0] client 0: search for tickets to Portugal for 23/10/11 [0,1,1] server: there is a ticket available for 505P [1,1,2] server: there is a ticket available for 505P [0,2,1] client 1: buy ticket [1,2,3] server: sold [2,1,2] client 0: buy ticket [2,2,4] server: tickets sold out [1,0,0] client 0: search for tickets to Portugal for 23/10/11 [1,0,1] server: there is a ticket available for 505P [0,1,0] client 1: search for tickets to Portugal for 23/10/11 [1,1,2] server: there is a ticket available for 505P [1,2,2] client 1: buy ticket [1,2,3] server: sold [2,0,1] client 0: buy ticket [2,2,4] server: tickets sold out [1,0,0] client 0: search for tickets to Portugal for 23/10/11 [1,0,1] server: there is a ticket available for 505P [0,1,0] client 1: search for tickets to Portugal for 23/10/11 [1,1,2] server: there is a ticket available for 505P [1,0,0] client 0: search for tickets to Portugal for 23/10/11 [1,0,1] server: there is a ticket available for 505P [2,0,1] client 0: buy ticket [2,0,2] server: sold [0,1,0] client 1: search for tickets to Portugal for 23/10/11 [2,1,3] server: tickets sold out
Executions:
13
Partially ordered log :
buy search search available sold-out sold available buy client 0 client 1 server buy search search available sold sold-out available buy client 0 client 1 server buy search search available sold sold-out available buy client 0 client 1 server search search available available client 0 client 1 server search sold available client 0 client 1 server buy search sold-out [1,0,0] client 0: search for tickets to Portugal for 23/10/11 [0,1,0] client 1: search for tickets to Portugal for 23/10/11 [1,0,1] server: there is a ticket available for 505P [1,1,2] server: there is a ticket available for 505P [2,0,1] client 0: buy ticket [2,1,3] server: sold [1,2,2] client 1: buy ticket [2,2,4] server: tickets sold out [0,1,0] client 1: search for tickets to Portugal for 23/10/11 [1,0,0] client 0: search for tickets to Portugal for 23/10/11 [0,1,1] server: there is a ticket available for 505P [1,1,2] server: there is a ticket available for 505P [0,2,1] client 1: buy ticket [1,2,3] server: sold [2,1,2] client 0: buy ticket [2,2,4] server: tickets sold out [1,0,0] client 0: search for tickets to Portugal for 23/10/11 [1,0,1] server: there is a ticket available for 505P [0,1,0] client 1: search for tickets to Portugal for 23/10/11 [1,1,2] server: there is a ticket available for 505P [1,2,2] client 1: buy ticket [1,2,3] server: sold [2,0,1] client 0: buy ticket [2,2,4] server: tickets sold out [1,0,0] client 0: search for tickets to Portugal for 23/10/11 [1,0,1] server: there is a ticket available for 505P [0,1,0] client 1: search for tickets to Portugal for 23/10/11 [1,1,2] server: there is a ticket available for 505P [1,0,0] client 0: search for tickets to Portugal for 23/10/11 [1,0,1] server: there is a ticket available for 505P [2,0,1] client 0: buy ticket [2,0,2] server: sold [0,1,0] client 1: search for tickets to Portugal for 23/10/11 [2,1,3] server: tickets sold out
Executions:
temporal invariants between events
14
x y
always followed by
liveness x y
always precedes
safety x y
never followed by
safety x y
always concurrent with
safety x y
never concurrent with
safety
15
x b
T1 T2
y a
Execution 1 Execution 3
x
T1 T2
y
Execution 2 T1 T2
y a b y x
1 2 1 2 1 2 1 2 1 2
x y
always followed by
liveness x y
always precedes
safety x y
never followed by
safety x y
always concurrent with
safety x y
never concurrent with
safety
15
x b
T1 T2
y a
Execution 1 Execution 3
x
T1 T2
y
Execution 2 T1 T2
y a b y x
1 2 1 2 1 2 1 2 1 2
x y
always followed by
liveness x y
always precedes
safety x y
never followed by
safety x y
always concurrent with
safety x y
never concurrent with
safety
15
Execution 1
x
T1 T2
y
Execution 2 T1 T2
y x x
1 2 1 2 1 2 1 2 1 2
x y
always followed by
liveness x y
always precedes
safety x y
never followed by
safety x y
always concurrent with
safety x y
never concurrent with
safety
15
x
T1 T2
y a
Execution 1 Execution 2
x
T1 T2
y y x
T3
b b
1 2 1 2 1 2 1 2 1 2
x y
always followed by
liveness x y
always precedes
safety x y
never followed by
safety x y
always concurrent with
safety x y
never concurrent with
safety
15
x b
T1 T2
y a
Execution 1 Execution 3
x
T1 T2
y
Execution 2 T1 T2
y y x x
1 2 1 2 1 2 1 2 1 2
16
17
18 always followed by always precedes never followed by always concurrent with never concurrent with
searchc0 k searchc1 sold-outs 6! solds sold-outs 6! buyc0 sold-outs 6! buyc1 solds ← sold-outs buyc0 ← sold-outs availables ← buyc0 availables ← buyc1 buyc0 → sold-outs buyc1 → sold-outs buyc0 k buyc1
18 always followed by always precedes never followed by always concurrent with never concurrent with
searchc0 k searchc1 sold-outs 6! solds sold-outs 6! buyc0 sold-outs 6! buyc1 solds ← sold-outs buyc0 ← sold-outs availables ← buyc0 availables ← buyc1 buyc0 → sold-outs buyc1 → sold-outs buyc0 k buyc1
Server event Client events
18 always followed by always precedes never followed by always concurrent with never concurrent with
searchc0 k searchc1 sold-outs 6! solds sold-outs 6! buyc0 sold-outs 6! buyc1 solds ← sold-outs buyc0 ← sold-outs availables ← buyc0 availables ← buyc1 buyc0 → sold-outs buyc1 → sold-outs buyc0 k buyc1
Temporal orderings between server and client events
18
Server-side correctness invariants
always followed by always precedes never followed by always concurrent with never concurrent with
searchc0 k searchc1 sold-outs 6! solds sold-outs 6! buyc0 sold-outs 6! buyc1 solds ← sold-outs buyc0 ← sold-outs availables ← buyc0 availables ← buyc1 buyc0 → sold-outs buyc1 → sold-outs buyc0 k buyc1
Temporal orderings between server and client events
18
Server-side correctness invariants Concurrency between clients
always followed by always precedes never followed by always concurrent with never concurrent with
searchc0 k searchc1 sold-outs 6! solds sold-outs 6! buyc0 sold-outs 6! buyc1 solds ← sold-outs buyc0 ← sold-outs availables ← buyc0 availables ← buyc1 buyc0 → sold-outs buyc1 → sold-outs buyc0 k buyc1
Temporal orderings between server and client events
18
Server-side correctness invariants Concurrency between clients Over-fit invariants
always followed by always precedes never followed by always concurrent with never concurrent with
searchc0 k searchc1 sold-outs 6! solds sold-outs 6! buyc0 sold-outs 6! buyc1 solds ← sold-outs buyc0 ← sold-outs availables ← buyc0 availables ← buyc1 buyc0 → sold-outs buyc1 → sold-outs buyc0 k buyc1
Temporal orderings between server and client events
concurrent executions
invariants
19
that omits “never concurrent with”
20
21
x b
T1 T2
y a
Execution 1 Execution 3
x
T1 T2
y
Execution 2 T1 T2
y a b y x x b
T1 T2
y a
Execution 1 Execution 3
x
T1 T2
y
Execution 2 T1 T2
y a b y x
Log Transitive Closure Invariants
always followed by
22
x b
T1 T2
y a
Execution 1 Execution 3
x
T1 T2
y
Execution 2 T1 T2
y a b y x
Log Counts Invariants
event total count x1 3 y2 4 ... ... event pair # co-occurrences x1,y2 3 ... ...
always followed by
system with H hosts that use vector clocks to maintain a partial order
23
Vary each variable to evaluate algorithm scalability
20 40 60 80 100 120 140 20 40 60 80 100 120 140 160 180 200 Time (s) Number of executions Transitive Closure Co-occurrence Counting v1 Co-occurrence Counting v2 50 100 150 200 250 300 500 1000 1500 2000 2500 Time (s) Length of an execution trace Transitive Closure Co-occurrence Counting v1 Co-occurrence Counting v2
24
50 100 150 200 250 300 5 10 15 20 25 30 35 40 45 50 Time (s) Nodes in the system Transitive Closure Co-occurrence Counting v1 Co-occurrence Counting v2 100 200 300 400 500 600 700 800 20 40 60 80 100 120 140 Time (s) Number of event types Transitive Closure Co-occurrence Counting v1 Co-occurrence Counting v2
penalty: extra network traffic/computation/state
complete view
25
Edwards et al. IPDPS 1994 Charron-Bost IPL 1991 Khotimsky and Zhuklinets ICATM 1999
Dwyer et al. ICSE 1999
increasingly important
concurrent system log
temporal invariants
26