Mining Temporal Invariants from Partially Ordered Logs Ivan - - PowerPoint PPT Presentation

mining temporal invariants from partially ordered logs
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Mining Temporal Invariants from Partially Ordered Logs

Ivan Beschastnikh Yuriy Brun Michael D. Ernst Arvind Krishnamurthy Thomas E. Anderson

University of Washington

slide-2
SLIDE 2

I am a developer. Why does my system behave in a certain manner? Motivating question

2

slide-3
SLIDE 3 src : 2, dst : 0, timestamp : 4, type : tx_commit src : 2, dst : 1, timestamp : 5, type : tx_commit src : 0, dst : 2, timestamp : 6, type : ack src : 1, dst : 2, timestamp : 7, type : ack src : 2, dst : 0, timestamp : 8, type : prepare src : 2, dst : 1, timestamp : 9, type : prepare src : 0, dst : 2, timestamp : 10, type : commit src : 1, dst : 2, timestamp : 11, type : commit src : 2, dst : 0, timestamp : 12, type : tx_commit src : 2, dst : 1, timestamp : 13, type : tx_commit src : 0, dst : 2, timestamp : 14, type : ack src : 1, dst : 2, timestamp : 15, type : ack src : 2, dst : 0, timestamp : 16, type : prepare src : 2, dst : 1, timestamp : 17, type : prepare src : 0, dst : 2, timestamp : 18, type : commit src : 1, dst : 2, timestamp : 19, type : commit src : 2, dst : 0, timestamp : 20, type : tx_commit src : 2, dst : 1, timestamp : 21, type : tx_commit src : 0, dst : 2, timestamp : 22, type : ack src : 1, dst : 2, timestamp : 23, type : ack src : 2, dst : 0, timestamp : 0, type : prepare src : 2, dst : 1, timestamp : 1, type : prepare src : 0, dst : 2, timestamp : 2, type : commit src : 1, dst : 2, timestamp : 3, type : commit src : 2, dst : 0, timestamp : 4, type : tx_commit src : 2, dst : 1, timestamp : 5, type : tx_commit src : 0, dst : 2, timestamp : 6, type : ack src : 1, dst : 2, timestamp : 7, type : ack src : 2, dst : 0, timestamp : 8, type : prepare src : 2, dst : 1, timestamp : 9, type : prepare src : 0, dst : 2, timestamp : 10, type : commit src : 1, dst : 2, timestamp : 11, type : commit src : 2, dst : 0, timestamp : 12, type : tx_commit src : 2, dst : 1, timestamp : 13, type : tx_commit src : 0, dst : 2, timestamp : 14, type : ack src : 1, dst : 2, timestamp : 15, type : ack src : 2, dst : 0, timestamp : 16, type : prepare src : 2, dst : 1, timestamp : 17, type : prepare src : 0, dst : 2, timestamp : 18, type : commit src : 1, dst : 2, timestamp : 19, type : commit src : 2, dst : 0, timestamp : 20, type : tx_commit src : 2, dst : 1, timestamp : 21, type : tx_commit src : 0, dst : 2, timestamp : 22, type : ack src : 1, dst : 2, timestamp : 23, type : ack src : 2, dst : 0, timestamp : 0, type : prepare src : 2, dst : 1, timestamp : 1, type : prepare src : 0, dst : 2, timestamp : 2, type : commit src : 1, dst : 2, timestamp : 3, type : commit src : 2, dst : 0, timestamp : 4, type : tx_commit src : 2, dst : 1, timestamp : 5, type : tx_commit src : 0, dst : 2, timestamp : 6, type : ack src : 1, dst : 2, timestamp : 7, type : ack src : 2, dst : 0, timestamp : 8, type : prepare src : 2, dst : 1, timestamp : 9, type : prepare src : 0, dst : 2, timestamp : 10, type : commit src : 1, dst : 2, timestamp : 11, type : commit src : 2, dst : 0, timestamp : 12, type : tx_commit src : 2, dst : 1, timestamp : 13, type : tx_commit src : 0, dst : 2, timestamp : 14, type : ack src : 1, dst : 2, timestamp : 15, type : ack src : 2, dst : 0, timestamp : 16, type : prepare src : 2, dst : 1, timestamp : 17, type : prepare src : 0, dst : 2, timestamp : 18, type : commit src : 1, dst : 2, timestamp : 19, type : commit src : 2, dst : 0, timestamp : 20, type : tx_commit src : 2, dst : 1, timestamp : 21, type : tx_commit src : 0, dst : 2, timestamp : 22, type : ack src : 1, dst : 2, timestamp : 23, type : ack src : 2, dst : 0, timestamp : 0, type : prepare src : 2, dst : 1, timestamp : 1, type : prepare src : 0, dst : 2, timestamp : 2, type : commit src : 1, dst : 2, timestamp : 3, type : commit src : 2, dst : 0, timestamp : 4, type : tx_commit src : 2, dst : 1, timestamp : 5, type : tx_commit src : 0, dst : 2, timestamp : 6, type : ack src : 1, dst : 2, timestamp : 7, type : ack src : 2, dst : 0, timestamp : 8, type : prepare src : 2, dst : 1, timestamp : 9, type : prepare src : 0, dst : 2, timestamp : 10, type : commit src : 1, dst : 2, timestamp : 11, type : commit src : 2, dst : 0, timestamp : 12, type : tx_commit src : 2, dst : 1, timestamp : 13, type : tx_commit src : 0, dst : 2, timestamp : 14, type : ack src : 1, dst : 2, timestamp : 15, type : ack src : 2, dst : 0, timestamp : 16, type : prepare src : 2, dst : 1, timestamp : 17, type : prepare src : 0, dst : 2, timestamp : 18, type : commit src : 1, dst : 2, timestamp : 19, type : commit src : 2, dst : 0, timestamp : 20, type : tx_commit src : 2, dst : 1, timestamp : 21, type : tx_commit src : 0, dst : 2, timestamp : 22, type : ack src : 1, dst : 2, timestamp : 23, type : ack src : 2, dst : 0, timestamp : 0, type : prepare src : 2, dst : 1, timestamp : 1, type : prepare src : 0, dst : 2, timestamp : 2, type : commit src : 1, dst : 2, timestamp : 3, type : commit src : 2, dst : 0, timestamp : 4, type : tx_commit src : 2, dst : 1, timestamp : 5, type : tx_commit src : 0, dst : 2, timestamp : 6, type : ack src : 1, dst : 2, timestamp : 7, type : ack src : 2, dst : 0, timestamp : 8, type : prepare src : 2, dst : 1, timestamp : 9, type : prepare src : 0, dst : 2, timestamp : 10, type : commit src : 1, dst : 2, timestamp : 11, type : commit src : 2, dst : 0, timestamp : 12, type : tx_commit src : 2, dst : 1, timestamp : 13, type : tx_commit src : 0, dst : 2, timestamp : 14, type : ack src : 1, dst : 2, timestamp : 15, type : ack src : 2, dst : 0, timestamp : 16, type : prepare src : 2, dst : 1, timestamp : 17, type : prepare src : 0, dst : 2, timestamp : 18, type : commit src : 1, dst : 2, timestamp : 19, type : commit src : 2, dst : 0, timestamp : 20, type : tx_commit src : 2, dst : 1, timestamp : 21, type : tx_commit src : 0, dst : 2, timestamp : 22, type : ack src : 1, dst : 2, timestamp : 23, type : ack src : 2, dst : 0, timestamp : 4, type : tx_commit src : 2, dst : 1, timestamp : 5, type : tx_commit src : 2, dst : 0, timestamp : 0, type : prepare src : 2, dst : 1, timestamp : 1, type : prepare src : 0, dst : 2, timestamp : 2, type : commit src : 1, dst : 2, timestamp : 3, type : commit src : 2, dst : 0, timestamp : 4, type : tx_commit src : 2, dst : 1, timestamp : 5, type : tx_commit src : 0, dst : 2, timestamp : 6, type : ack src : 1, dst : 2, timestamp : 7, type : ack src : 2, dst : 0, timestamp : 8, type : prepare src : 2, dst : 1, timestamp : 9, type : prepare src : 0, dst : 2, timestamp : 10, type : commit src : 1, dst : 2, timestamp : 11, type : commit src : 2, dst : 0, timestamp : 12, type : tx_commit src : 2, dst : 1, timestamp : 13, type : tx_commit src : 0, dst : 2, timestamp : 14, type : ack src : 1, dst : 2, timestamp : 15, type : ack src : 2, dst : 0, timestamp : 16, type : prepare src : 2, dst : 1, timestamp : 17, type : prepare src : 0, dst : 2, timestamp : 18, type : commit src : 1, dst : 2, timestamp : 19, type : commit src : 2, dst : 0, timestamp : 20, type : tx_commit src : 2, dst : 1, timestamp : 21, type : tx_commit src : 0, dst : 2, timestamp : 22, type : ack src : 1, dst : 2, timestamp : 23, type : ack src : 2, dst : 0, timestamp : 0, type : prepare src : 2, dst : 1, timestamp : 1, type : prepare src : 0, dst : 2, timestamp : 2, type : commit src : 1, dst : 2, timestamp : 3, type : commit src : 2, dst : 0, timestamp : 4, type : tx_commit src : 2, dst : 1, timestamp : 5, type : tx_commit src : 0, dst : 2, timestamp : 6, type : ack src : 1, dst : 2, timestamp : 7, type : ack src : 2, dst : 0, timestamp : 8, type : prepare src : 2, dst : 1, timestamp : 9, type : prepare src : 0, dst : 2, timestamp : 10, type : commit src : 1, dst : 2, timestamp : 11, type : commit src : 2, dst : 0, timestamp : 12, type : tx_commit src : 2, dst : 1, timestamp : 13, type : tx_commit src : 0, dst : 2, timestamp : 14, type : ack src : 1, dst : 2, timestamp : 15, type : ack src : 2, dst : 0, timestamp : 16, type : prepare src : 2, dst : 1, timestamp : 17, type : prepare src : 0, dst : 2, timestamp : 18, type : commit src : 1, dst : 2, timestamp : 19, type : commit src : 2, dst : 0, timestamp : 20, type : tx_commit src : 2, dst : 1, timestamp : 21, type : tx_commit src : 0, dst : 2, timestamp : 22, type : ack src : 1, dst : 2, timestamp : 23, type : ack src : 2, dst : 0, timestamp : 0, type : prepare src : 2, dst : 1, timestamp : 1, type : prepare src : 0, dst : 2, timestamp : 2, type : commit src : 1, dst : 2, timestamp : 3, type : commit src : 2, dst : 0, timestamp : 4, type : tx_commit src : 2, dst : 1, timestamp : 5, type : tx_commit src : 0, dst : 2, timestamp : 6, type : ack src : 1, dst : 2, timestamp : 7, type : ack src : 2, dst : 0, timestamp : 8, type : prepare src : 2, dst : 1, timestamp : 9, type : prepare src : 0, dst : 2, timestamp : 10, type : commit src : 1, dst : 2, timestamp : 11, type : commit src : 2, dst : 0, timestamp : 12, type : tx_commit src : 2, dst : 1, timestamp : 13, type : tx_commit src : 0, dst : 2, timestamp : 14, type : ack src : 1, dst : 2, timestamp : 15, type : ack src : 2, dst : 0, timestamp : 16, type : prepare src : 2, dst : 1, timestamp : 17, type : prepare src : 0, dst : 2, timestamp : 18, type : commit src : 1, dst : 2, timestamp : 19, type : commit src : 2, dst : 0, timestamp : 20, type : tx_commit src : 2, dst : 1, timestamp : 21, type : tx_commit src : 0, dst : 2, timestamp : 22, type : ack src : 1, dst : 2, timestamp : 23, type : ack src : 2, dst : 0, timestamp : 0, type : prepare src : 2, dst : 1, timestamp : 1, type : prepare src : 0, dst : 2, timestamp : 2, type : commit src : 1, dst : 2, timestamp : 3, type : commit src : 2, dst : 0, timestamp : 4, type : tx_commit src : 2, dst : 1, timestamp : 5, type : tx_commit src : 0, dst : 2, timestamp : 6, type : ack src : 1, dst : 2, timestamp : 7, type : ack src : 2, dst : 0, timestamp : 8, type : prepare src : 2, dst : 1, timestamp : 9, type : prepare src : 0, dst : 2, timestamp : 10, type : commit src : 1, dst : 2, timestamp : 11, type : commit src : 2, dst : 0, timestamp : 12, type : tx_commit src : 2, dst : 1, timestamp : 13, type : tx_commit src : 0, dst : 2, timestamp : 14, type : ack src : 1, dst : 2, timestamp : 15, type : ack src : 2, dst : 0, timestamp : 16, type : prepare src : 2, dst : 1, timestamp : 17, type : prepare src : 0, dst : 2, timestamp : 18, type : commit src : 1, dst : 2, timestamp : 19, type : commit src : 2, dst : 0, timestamp : 20, type : tx_commit src : 2, dst : 1, timestamp : 21, type : tx_commit src : 0, dst : 2, timestamp : 22, type : ack src : 1, dst : 2, timestamp : 23, type : ack src : 2, dst : 0, timestamp : 16, type : prepare src : 2, dst : 1, timestamp : 17, type : prepare src : 0, dst : 2, timestamp : 18, type : commit src : 1, dst : 2, timestamp : 19, type : commit src : 2, dst : 0, timestamp : 20, type : tx_commit src : 2, dst : 1, timestamp : 21, type : tx_commit src : 0, dst : 2, timestamp : 22, type : ack src : 1, dst : 2, timestamp : 23, type : ack src : 1, dst : 2, timestamp : 19, type : commit

Synoptic (our prior work)

A tool that mines FSM models from logs

3

Input

...

propose commit tx-commit tx-abort abort commit abort

Synoptic

Output

slide-4
SLIDE 4

Why does my concurrent system behave in a certain manner? But, what if the question is ...

4

slide-5
SLIDE 5

Log analysis of concurrent systems

  • Concurrency is widespread and is becoming

commonplace (Hadoop, Ajax, Multicore)

  • Many log analysis tools exist to help understand

sequential, but not concurrent systems

  • Assume totally ordered logs
  • Cannot reason about concurrent executions
  • Insufficient for debugging concurrency issues

5

slide-6
SLIDE 6

Log analysis of concurrent systems

  • Concurrency is widespread and is becoming

commonplace (Hadoop, Ajax, Multicore)

  • Many log analysis tools exist to help understand

sequential, but not concurrent systems

  • Assume totally ordered logs
  • Cannot reason about concurrent executions
  • Insufficient for debugging concurrency issues

Need to develop tools for concurrent systems logs

5

slide-7
SLIDE 7

Our approach

  • Mine the partially ordered log to extract temporal

invariants between events

  • Capture the essence of what happened
  • Simple to understand
  • Show invariants to the developer
  • May notice missing invariants
  • May find unexpected invariants
  • Developer modifies and re-runs the system

6

slide-8
SLIDE 8

Outline

  • Motivation
  • Why a total order is not enough
  • Mining temporal invariants from

concurrent executions

  • Tool demo
  • Two algorithms to mine temporal

invariants

  • Algorithms’ scalability evaluation

7

slide-9
SLIDE 9
  • A system with two threads: T1, T2
  • T1 generates event , T2 generates event

Limitations of total order

8

T1 T2 Logger Log file

1 a 2 b

a

b

  • Generated log file:
  • Logging pipeline:
slide-10
SLIDE 10

Limitations of total order

9

a b

T1 T2

a b

T1 T2

a b

T1 T2

T1 T2 Logger Log file

1 a 2 b

a

b

  • Generated log file:
  • Logging pipeline:

Which of these three systems generated the log?

  • A system with two threads: T1, T2
  • T1 generates event , T2 generates event
slide-11
SLIDE 11
  • A system with two threads: T1, T2
  • T1 generates event , T2 generates event

Limitations of total order

10

a b

T1 T2

a b

T1 T2

a b

T1 T2

T1 T2 Logger Log file

1 a 2 b

a

b

  • Generated log file:
  • Logging pipeline:

A totally ordered log is insufficient.

slide-12
SLIDE 12

Logging the partial order

  • We know how to do this
  • Lamport defined the happens-before relation in 1978
  • Operationalized with vector clocks in 1988, 1989

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

slide-13
SLIDE 13

Example system

  • A server with tickets, two clients who buy tickets
  • Each client checks availability of tickets and then

buys a ticket

12

Server Client 0 Client 1 Tickets DB

slide-14
SLIDE 14

Partial order is complex

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:

slide-15
SLIDE 15

Partial order is complex

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:

slide-16
SLIDE 16

Partial order is complex

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:

Need a way to summarize a partially ordered log

slide-17
SLIDE 17

Temporal invariants

  • Mine the partially ordered log to extract

temporal invariants between events

  • Temporal invariants
  • True for all logged executions
  • Capture the essence of what happened
  • Simple to understand
  • Each invariants involves at most two hosts
  • Summarize the partial order

14

slide-18
SLIDE 18

Invariant Type

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

Five temporal log invariants

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

slide-19
SLIDE 19

Invariant Type

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

Five temporal log invariants

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

slide-20
SLIDE 20

Invariant Type

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

Five temporal log invariants

15

Execution 1

x

T1 T2

y

Execution 2 T1 T2

y x x

1 2 1 2 1 2 1 2 1 2

slide-21
SLIDE 21

Invariant Type

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

Five temporal log invariants

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

slide-22
SLIDE 22

Invariant Type

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

Five temporal log invariants

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

slide-23
SLIDE 23

DEMO

16

slide-24
SLIDE 24

Mined invariants

17

slide-25
SLIDE 25

Mined invariants

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

slide-26
SLIDE 26

Mined invariants

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

slide-27
SLIDE 27

Mined invariants

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

slide-28
SLIDE 28

Mined invariants

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

slide-29
SLIDE 29

Mined invariants

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

slide-30
SLIDE 30

Mined invariants

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

slide-31
SLIDE 31

Outline

  • Motivation
  • Why a total order is not enough
  • Mining temporal invariants from

concurrent executions

  • Tool demo
  • Two algorithms to mine temporal

invariants

  • Algorithms’ scalability evaluation

19

slide-32
SLIDE 32

Algorithms to mine invariants

  • 1. An algorithm based on the transitive closure
  • 2. A co-occurrence counting algorithm (v1)
  • 3. A modified co-occurrence counting algorithm (v2)

that omits “never concurrent with”

20

More details in the paper

slide-33
SLIDE 33

Transitive closure mining

  • Compute the transitive closure of all execution DAGs
  • Use the transitive closure to compute invariants

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

x1 → y2

always followed by

slide-34
SLIDE 34

Co-occurrence counting mining

22

  • Count the number of times events co-occur
  • Use counts to compute invariants

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

x1 → y2

always followed by

slide-35
SLIDE 35

Evaluation methodology

  • A discrete time simulator of a distributed

system with H hosts that use vector clocks to maintain a partial order

  • Each host generates a total of E events
  • Each event is one of T types
  • Hosts communicate with probability 0.3
  • Invariants are mined from the resulting log

23

Vary each variable to evaluate algorithm scalability

slide-36
SLIDE 36

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

Scalability results

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

slide-37
SLIDE 37
  • Logging the partial order explicitly has a performance

penalty: extra network traffic/computation/state

  • Has been previously studied
  • Invariants are a summary and do not provide a

complete view

  • Visualization of distributed traces

Limitations and future work

25

Edwards et al. IPDPS 1994 Charron-Bost IPL 1991 Khotimsky and Zhuklinets ICATM 1999

Dwyer et al. ICSE 1999

slide-38
SLIDE 38

Conclusion

  • Studying logs of concurrent systems is becoming

increasingly important

  • Temporal invariants can help explain a complex

concurrent system log

  • Presented algorithms to mine five types of

temporal invariants

26

http://synoptic.googlecode.com

Try it!