BigDebug: Debugging Primitives for Interactive Big Data - - PowerPoint PPT Presentation

bigdebug debugging primitives for interactive big data
SMART_READER_LITE
LIVE PREVIEW

BigDebug: Debugging Primitives for Interactive Big Data - - PowerPoint PPT Presentation

BigDebug: Debugging Primitives for Interactive Big Data Processing in Spark Muhammad Ali Gulzar, Matteo Interlandi, Seunghyun Yoo, Sai Deep Tetali, Tyson Condie,


slide-1
SLIDE 1

BigDebug: ¡Debugging ¡Primitives ¡for ¡ Interactive ¡Big ¡Data ¡Processing ¡in ¡Spark

Muhammad ¡ Ali ¡Gulzar, Matteo ¡Interlandi, ¡ Seunghyun ¡Yoo, ¡Sai ¡Deep ¡Tetali, ¡ Tyson ¡Condie, ¡Todd ¡Millstein, ¡Miryung ¡Kim University ¡ of ¡California, ¡ Los ¡Angeles

1

slide-2
SLIDE 2

Developing ¡Big ¡Data ¡Analytics

  • Big ¡Data ¡Analytics ¡is ¡becoming ¡increasingly ¡important. ¡
  • Big ¡Data ¡Analytics ¡are ¡built ¡using ¡data ¡intensive ¡computing ¡

platforms ¡such ¡as ¡Map ¡Reduce, ¡Hadoop, ¡and ¡Apache ¡Spark. ¡

Apache Pig Map Reduce 2

slide-3
SLIDE 3

Apache ¡Spark: ¡Next ¡Generation ¡Map ¡Reduce

  • Apache ¡Spark ¡is ¡up ¡to ¡100X ¡faster ¡than ¡Hadoop MapReduce
  • It ¡is ¡open ¡source ¡and ¡over ¡800 ¡developers ¡have ¡contributed ¡in ¡its ¡

development

  • 200+ ¡companies ¡are ¡currently ¡using ¡Spark ¡
  • Spark ¡also ¡provides ¡libraries ¡such ¡as ¡SparkSQL and ¡Mllib

3

slide-4
SLIDE 4

Running ¡a ¡Map ¡Reduce ¡Job ¡on ¡Cluster

A ¡job ¡is ¡distributed ¡to ¡ workers ¡in ¡cluster

Each ¡worker ¡performs ¡pipelined ¡transformations ¡on ¡a ¡ partition ¡with ¡millions ¡of ¡records

A ¡user ¡submits ¡a ¡job

Reduce Filter Map 4

slide-5
SLIDE 5

Motivating ¡Scenario: ¡Election ¡Record ¡Analysis

  • Alice ¡writes ¡a ¡Spark ¡program ¡

that ¡runs ¡correctly ¡on ¡local ¡ machine ¡(100MB ¡data) ¡but ¡ crashes ¡on ¡cluster ¡(1TB)

  • Alice ¡cannot ¡see ¡the ¡crash-­‑

inducing ¡intermediate ¡ result. ¡

  • Alice ¡cannot ¡identify ¡which ¡input ¡

from ¡1TB ¡causing ¡crash

  • When ¡crash ¡occurs, ¡all ¡

intermediate ¡ results ¡are ¡thrown ¡ away.

val log = "s3n://poll.log" val text_file = spark.textFile(log) val count = text_file .filter( line => line.split()[3].toInt > 1440012701) .map(line = > (line.split()[1] , 1)) .reduceByKey(_ + _).collect() 1 2 3 4 5 6 7

VoterID Candidate ¡ ¡State ¡ ¡Time 9213 Sanders ¡ ¡ ¡ ¡ ¡ TX 1440023087

5

slide-6
SLIDE 6

Motivating ¡Scenario: ¡Election ¡Record ¡Analysis

  • Alice ¡writes ¡a ¡Spark ¡program ¡

that ¡runs ¡correctly ¡on ¡local ¡ machine ¡(100MB ¡data ¡) ¡but ¡ crashes ¡on ¡cluster ¡(1TB)

  • Alice ¡cannot ¡see ¡the ¡crash-­‑

inducing ¡intermediate ¡ result. ¡

  • Alice ¡cannot ¡identify ¡which ¡input ¡

from ¡1TB ¡causing ¡crash

  • When ¡crash ¡occurs, ¡all ¡

intermediate ¡ results ¡are ¡thrown ¡ away.

1 2 3 4 5 6 7

VoterID Candidate ¡ ¡State ¡ ¡Time 9213 Sanders ¡ ¡ ¡ ¡ ¡ TX 1440023087

Task 31 failed 3 times; aborting job ERROR Executor: Exception in task 31 in stage 0 (TID 31) java.lang.NumberFormatException

6 val log = "s3n://poll.log" val text_file = spark.textFile(log) val count = text_file .filter( line => line.split()[3].toInt > 1440012701) .map(line = > (line.split()[1] , 1)) .reduceByKey(_ + _).collect()

slide-7
SLIDE 7

BigDebug: ¡Interactive ¡Debugger ¡Features

Simulated ¡Breakpoint 1 Crash ¡Culprit ¡Identification 3 Guarded ¡Watchpoint 2 Backward ¡and ¡Forward ¡ Tracing 4

Crashing at transformation 2 Crashing Record : “Sanders” ArrayIndexOutofBoundException

$>Crash inducing input records : 9K23 Cruz TX 1440023645 2FSD Cruz KS 1440026456 9909 Cruz KS 1440023768

7

slide-8
SLIDE 8

Outline

  • Interactive ¡Debugging ¡Primitives
  • 1. ¡Simulated ¡Breakpoint
  • 2. ¡On-­‑Demand ¡Watchpoint
  • 3. ¡Crash ¡Culprit Identification
  • 4. ¡Backward ¡and ¡Forward ¡Tracing
  • 5. ¡Fine ¡Grained ¡Latency ¡Alert
  • Performance ¡Evaluation

8

slide-9
SLIDE 9

Why ¡Traditional ¡Debug ¡Primitives ¡Do ¡Not ¡Work ¡ for ¡Apache ¡Spark?

Enabling ¡interactive ¡debugging ¡requires ¡us ¡to re-­‑think ¡the ¡features ¡

  • f ¡traditional ¡debugger ¡such ¡as ¡GDB
  • Pausing ¡the ¡entire ¡computation ¡on ¡the ¡cloud ¡could ¡reduce ¡

throughput

  • It ¡is ¡clearly ¡infeasible ¡for ¡a ¡user ¡to ¡inspect ¡billion ¡of ¡records ¡

through ¡a ¡regular ¡watchpoint

  • Even ¡launching ¡remote ¡JVM ¡debuggers ¡to ¡individual ¡worker ¡

nodes ¡cannot ¡scale ¡for ¡big ¡data ¡computing

9

slide-10
SLIDE 10

Spark ¡Program ¡with ¡Transformations

Flatmap Map ReduceByKey Map ReduceByKey Filter 10

slide-11
SLIDE 11

Spark ¡Program ¡Scheduled ¡as ¡Stages

Stage ¡3 Stage ¡2 Stage ¡1 Flatmap Map ReduceByKey Map ReduceByKey Filter 11

slide-12
SLIDE 12

Stage ¡3 Stage ¡2 Stage ¡1

Materialization ¡Points ¡in ¡Spark ¡

Flatmap Map ReduceByKey Map ReduceByKey Filter

Stored ¡data ¡ records

12

slide-13
SLIDE 13

Stage ¡3 Stage ¡2 Stage ¡1

  • 1. ¡Simulated ¡Breakpoint

Flatmap Map ReduceByKey Map ReduceByKey Filter

Stored ¡data ¡ records

13

slide-14
SLIDE 14

Stage ¡3 Stage ¡2 Stage ¡1

  • 1. ¡Simulated ¡Breakpoint

Flatmap Map ReduceByKey Map ReduceByKey Filter

Breakpoint

Stored ¡data ¡ records

14

slide-15
SLIDE 15

Stage ¡3 Stage ¡2 Stage ¡1

  • 1. ¡Simulated ¡Breakpoint

Flatmap Map ReduceByKey Map ReduceByKey Filter

Breakpoint

Stored ¡data ¡ records

Simulated ¡breakpoint ¡replays ¡computation ¡from ¡the ¡latest ¡ materialization ¡point ¡where ¡data ¡is ¡stored ¡in ¡memory

15

slide-16
SLIDE 16
  • 1. ¡Simulated ¡Breakpoint – Realtime Code ¡Fix ¡

Stage ¡3 Stage ¡2 Stage ¡1 Flatmap Map ReduceByKey Map ReduceByKey Filter

Breakpoint Allow ¡a ¡user ¡to ¡fix ¡code ¡after ¡the ¡breakpoint

16

slide-17
SLIDE 17

Stage ¡2

  • 2. ¡On-­‑Demand ¡Guarded ¡Watchpoint

ReduceByKey Map Watchpoint

Watchpoint captures ¡individual ¡data ¡records ¡matching ¡a ¡user-­‑ provided ¡guard

Stage ¡1 Flatmap Map 17

slide-18
SLIDE 18

state.equals(“TX”)||state.equals(“CA”) ¡

Stage ¡2

  • 2. ¡On-­‑Demand ¡Guarded ¡Watchpoint

ReduceByKey Map Watchpoint

Watchpoint captures ¡individual ¡data ¡records ¡matching ¡a ¡user-­‑ provided ¡guard

Stage ¡1 Flatmap Map 18

slide-19
SLIDE 19

Stage ¡2

  • 2. ¡On-­‑Demand ¡Guarded ¡Watchpoint

ReduceByKey Map Watchpoint

Watchpoint captures ¡individual ¡data ¡records ¡matching ¡a ¡user-­‑ provided ¡guard

Stage ¡1 Flatmap Map 19

state.equals(“CA”) ¡

slide-20
SLIDE 20

Crash ¡in ¡Apache ¡Spark

To ¡recover ¡to ¡from ¡crash, ¡a ¡user ¡need ¡to ¡find ¡input ¡causing ¡crash ¡ and ¡re-­‑execute ¡the ¡whole ¡job.

A ¡job ¡failure ¡in ¡Spark ¡throws ¡away ¡the ¡intermediate ¡ results ¡ of ¡correctly ¡ computed ¡stages

Task 31 failed 3 times; aborting job ERROR Executor: Exception in task 31 in stage 0 (TID 31) java.lang.NumberFormatException Stage ¡3 Stage ¡2 Stage ¡1 Flatmap Map ReduceByKey Map ReduceByKey Filter 20

slide-21
SLIDE 21
  • 3. ¡Crash ¡Culprit ¡Identification

A ¡user ¡can ¡see ¡the ¡crash-­‑causing ¡intermediate ¡record ¡and ¡trace ¡the ¡

  • riginal ¡inputs ¡leading ¡to ¡the ¡crash.

Stage ¡3 Stage ¡2 Stage ¡1 Flatmap Map ReduceByKey Map ReduceByKey Filter Crash occurred at transformation 3 Crashing Record : “Sanders” ArrayIndexOutofBoundException Skipping the record. Continuing processing. 21

slide-22
SLIDE 22
  • 3. ¡Crash ¡Culprit Remediation

A ¡user ¡can ¡either ¡correct ¡the ¡crashed ¡record, ¡skip ¡the ¡crash ¡culprit, ¡

  • r ¡supply ¡a ¡code ¡fix ¡to ¡repair ¡the ¡crash ¡culprit. ¡

Stage ¡3 Stage ¡2 Stage ¡1 Flatmap Map ReduceByKey Map ReduceByKey Filter 22

slide-23
SLIDE 23
  • 4. ¡Backward ¡and ¡Forward ¡Tracing

Stage ¡3 Stage ¡2 Stage ¡1 Flatmap Map ReduceByKey Map ReduceByKey Filter

A ¡user ¡can ¡also ¡issue ¡tracing ¡queries ¡on ¡intermediate ¡records ¡at ¡ realtime

23

slide-24
SLIDE 24
  • 4. ¡Backward ¡and ¡Forward ¡Tracing

Stage ¡3 Stage ¡2 Stage ¡1 Flatmap Map ReduceByKey Map ReduceByKey Filter

A ¡user ¡can ¡also ¡issue ¡tracing ¡queries ¡on ¡intermediate ¡records ¡at ¡ realtime

24

slide-25
SLIDE 25

Input Output ¡

a y b w … …

Titian: ¡Data ¡Provenance ¡for ¡Spark ¡[PVLDB2016]

Titian ¡logically ¡reconstructs ¡mapping ¡from ¡output ¡to ¡input ¡records ¡ by ¡recursively ¡joining ¡the ¡provenance ¡tables

Input Output ¡ a 25 b … … Input Output ¡ t x a y c z … … Input Output ¡

a 25 b

Step ¡2 Step ¡1

Titian ¡instruments ¡Spark ¡jobs ¡with ¡tracing ¡agents ¡to ¡generate ¡fine ¡ grained ¡tracing ¡tables

Tracing ¡Table ¡2 Tracing ¡Table ¡3 Tracing ¡Table ¡1

Input Output ¡ x

y 1

… …

w 10 25

slide-26
SLIDE 26

Stage ¡3 Stage ¡2 Stage ¡1

  • 5. ¡Fine ¡Grained ¡Latency ¡Alert

Flatmap Map ReduceByKey Map ReduceByKey Filter

A ¡latency ¡alert ¡is ¡issued ¡ ¡if ¡the ¡processing ¡time ¡is ¡greater ¡than ¡k ¡ standard ¡deviations ¡above ¡the ¡moving ¡average ¡ Latency ¡alert ¡is ¡enabled ¡

26

slide-27
SLIDE 27

44ms 400ms 10ms 20ms

  • 5. ¡Fine ¡Grained ¡Latency ¡Alert

A ¡latency ¡alert ¡is ¡issued ¡ ¡if ¡the ¡processing ¡time ¡is ¡greater ¡than ¡k ¡ standard ¡deviations ¡above ¡the ¡moving ¡average ¡

Stage ¡3 Stage ¡2 Stage ¡1 Flatmap Map ReduceByKey Map ReduceByKey Filter

Latency ¡alert ¡is ¡enabled ¡

27

slide-28
SLIDE 28

Evaluation

  • Q1 ¡: ¡How ¡does ¡BigDebugscale to ¡massive ¡data?
  • Q2 ¡: ¡What ¡is ¡the ¡performance ¡overhead of ¡instrumentation ¡and ¡

communication ¡for ¡debugging ¡primitives?

  • Q3 ¡: ¡How ¡much ¡time ¡saving does ¡BigDebugprovide ¡through ¡its ¡

runtime ¡crash ¡remediation, ¡in ¡comparison ¡to ¡an ¡existing ¡replay ¡ debugger?

28

slide-29
SLIDE 29

Q1 ¡: ¡How ¡does ¡BigDebug scale ¡to ¡massive ¡data?

1 10 100 1000 10000 0.5 0.9 4 8 30 70 200 1000 Time ¡(s) Dataset ¡Size ¡(GB)

BigDebug ¡Scale ¡Up

Spark

29

slide-30
SLIDE 30

Q1 ¡: ¡How ¡does ¡BigDebug scale ¡to ¡massive ¡data?

BigDebugretains ¡scale ¡up ¡property ¡of ¡Spark. ¡This ¡property ¡is ¡ critical ¡for ¡Big ¡Data ¡processing ¡frameworks

1 10 100 1000 10000 0.5 0.9 4 8 30 70 200 1000 Time ¡(s) Dataset ¡Size ¡(GB)

BigDebug ¡Scale ¡Up

BigDebug Spark

30

slide-31
SLIDE 31

Q1 ¡: ¡How ¡does ¡BigDebug scale ¡to ¡massive ¡data?

100 200 300 2 4 6 8 Time ¡(s) Number ¡of ¡Workers

BigDebug ¡Scale ¡Out

Spark ¡10GB Spark ¡30GB Spark ¡50GB

31

slide-32
SLIDE 32

Q1 ¡: ¡How ¡does ¡BigDebug scale ¡to ¡massive ¡data?

BigDebugretains ¡scale ¡out ¡property ¡of ¡Spark. ¡This ¡property ¡is ¡ critical ¡for ¡Big ¡Data ¡processing ¡frameworks

100 200 300 400 2 4 6 8 Time ¡(s) Number ¡of ¡Workers

BigDebug ¡Scale ¡Out

BigDebug ¡10GB BigDebug ¡30GB BigDebug ¡50GB Spark ¡10GB Spark ¡30GB Spark ¡50GB

32

slide-33
SLIDE 33

Q2 ¡: ¡What ¡is ¡the ¡performance ¡overhead ¡of ¡ debugging ¡primitives?

Program Dataset ¡ size ¡(GB) Max Max ¡w/o ¡ Latency ¡ Alert Watchpoint Crash ¡ Culprit Tracing WordCount 0.5 -­‑ 1000 2.5X 1.34X 1.09X 1.18X 1.22X Grep 20 ¡-­‑ 90 1.76X 1.07X 1.05X 1.04X 1.05X PigMix-­‑L1 1 ¡-­‑ 200 1.38X 1.29X 1.03X 1.19X 1.24X

BigDebugposes ¡at ¡most ¡2.5X ¡overhead ¡with ¡the ¡maximum ¡ instrumentation ¡setting. ¡

Max ¡: ¡All ¡the ¡features ¡of ¡BigDebugare ¡enabled ¡

33

slide-34
SLIDE 34

Q3 ¡: ¡How ¡much ¡time ¡saving ¡does ¡BigDebug provide ¡when ¡resolving ¡crash?

Stage ¡3 Stage ¡2 Stage ¡1 Flatmap Map ReduceByKey Map ReduceByKey Filter

The ¡first ¡run ¡crashes

Arthur Suppose ¡that ¡a ¡user ¡wants ¡to ¡skip ¡or ¡correct ¡the ¡crash ¡causing ¡inputs. ¡

34

slide-35
SLIDE 35

Q3 ¡: ¡How ¡much ¡time ¡saving ¡does ¡BigDebug provide ¡when ¡resolving ¡crash?

Stage ¡3 Stage ¡2 Stage ¡1 Flatmap Map ReduceByKey Map ReduceByKey Filter

The ¡first ¡run ¡crashes The ¡second ¡run ¡instruments ¡ all ¡records ¡leading ¡to ¡a ¡crash The ¡third ¡run ¡removes ¡ the ¡crash ¡inducing ¡records ¡from ¡the ¡inputs. ¡

Arthur Suppose ¡that ¡a ¡user ¡wants ¡to ¡skip ¡or ¡correct ¡the ¡crash ¡causing ¡inputs. ¡

35

slide-36
SLIDE 36

Q3 ¡: ¡How ¡much ¡time ¡saving ¡does ¡BigDebug provide ¡when ¡resolving ¡crash?

Stage ¡3 Stage ¡2 Stage ¡1 Flatmap Map ReduceByKey Map ReduceByKey Filter

The ¡first ¡run ¡crashes The ¡second ¡run ¡instruments ¡ all ¡records ¡leading ¡to ¡a ¡crash The ¡third ¡run ¡removes ¡ the ¡crash ¡inducing ¡records ¡from ¡the ¡inputs. ¡

Arthur Suppose ¡that ¡a ¡user ¡wants ¡to ¡skip ¡or ¡correct ¡the ¡crash ¡causing ¡inputs. ¡ BigDebug

A ¡single ¡run ¡can ¡detect ¡and ¡remove ¡ the ¡crash ¡culprit ¡and ¡resumes ¡ the ¡job

36

slide-37
SLIDE 37

Q3 ¡: ¡How ¡much ¡time ¡saving ¡does ¡BigDebug provide?

BigDebugfinds ¡a ¡crash ¡inducing ¡record ¡with ¡100% ¡accuracy ¡and saves ¡upto ¡100% ¡time ¡saving ¡through ¡runtime ¡crash ¡remediation

50 100 150 200 250 S1 S2 S3 S4 Time ¡(s) Location ¡of ¡crash ¡(Stage)

Time ¡saving ¡

BigDebug Arthur

37

slide-38
SLIDE 38

Conclusion

  • Debugging ¡big ¡data ¡applications ¡is ¡painstakingand ¡expensive
  • BigDebugprovides ¡interactive ¡debugging ¡primitives ¡for ¡high ¡

performance ¡in-­‑memory ¡processing ¡in ¡Spark

  • BigDebugoffers ¡simulated ¡breakpoints ¡and ¡guarded ¡

watchpointswith ¡little ¡performance ¡overhead ¡

  • It ¡scales ¡to ¡massive ¡data ¡in ¡the ¡order ¡of ¡terabytes, ¡its ¡record ¡

level ¡tracing ¡poses ¡25% ¡overhead ¡and ¡provides ¡up ¡to ¡100% ¡ time ¡saving

  • BigDebugis ¡publically ¡available ¡at

https://sites.google.com/site/sparkbigdebug/

38