28
Speculative Execution IN A DISTRIBUTED FILE SYSTEM

Speculative Execution

  • Upload
    others

  • View
    20

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Speculative Execution

Speculative Execution

IN A DISTRIBUTED FILE SYSTEM

Page 2: Speculative Execution

Consistency is Slow• Synchronous client-server communication• Even slow over LAN

• Performance vs. Consistency and Safety

• Close-to-open consistency (NFS)

Page 3: Speculative Execution

SynchronousExecution

Speculative Execution in a Distributed File SystemEdmund B. Nightingale, Peter M. Chen, and Jason Flinn

Page 4: Speculative Execution

What can we do?

Page 5: Speculative Execution

What can we Take Advantage of?#1: Filesystems know themselves.

#2: Rollback to a checkpoint > server round-trip time.

#3: Modern CPUs have resources to spare.

Page 6: Speculative Execution

Speculator

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

Page 7: Speculative Execution

Speculator• Speculative (asynchronous) execution.

• Lightweight check-pointing and rollback.

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

Page 8: Speculative Execution

SpeculativeExecution

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

Page 9: Speculative Execution

Data StructuresMade for Speculator

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

Speculation• Tracks all objects dependent on a

speculation.

Undo Log• Tracks all modifications to an

object.• Each object that relates to a

speculation gets one.• Where checkpoints are stored.

Spec 1

Write

Ckpt

Page 10: Speculative Execution

Checkpointing• Fork of the current process stored in undo log.

• Additional state information (open files, signals, etc.).

• No more than 500ms apart.

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

Page 11: Speculative Execution

Rollback• When speculation is incorrect.

• Current process “failed”, replaced by checkpoint, all modifications gone.• Replaces process id, thread group id, files descriptors, signals, ...

• … Identity theft?

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

Page 12: Speculative Execution

Checkpoint“failed” Process

Page 13: Speculative Execution

Interface• create_speculation()

• commit_speculation()

• fail_speculation()

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

Page 14: Speculative Execution

Speculator• Speculative (asynchronous) execution.

• Lightweight check-pointing and rollback.

• Propagating causal dependencies between processes.• Multi-process speculation.

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

Page 15: Speculative Execution

When to Propagate?When P modifies X (or same file as X) and P depends on speculations that X does not, propagate P’s dependencies to X.

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

Page 16: Speculative Execution

Propagating Causal Dependencies

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

Page 17: Speculative Execution

Propagating Causal Dependencies

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

Page 18: Speculative Execution

More Speculator Design/Implementation

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

• Speculative processes can never output anything (screen, network, …).

• Never write Speculative state to Disk.

• Groups commits (increase throughput).• When network buffer is empty/100 ops processed → group commit.

• Handling mutating operations by trusting Server to know true state of file system.

• Managing shared meta-data structs: superblock, allocation bit-map, …

• Shadow buffer.

Page 19: Speculative Execution

What was Built

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

SpecNFS

• NFS with Speculator.

• Non-deterministic RPC field values.• Aliased until resolved.

• Employs group commits.

BlueFS

• Single-copy consistency.

• Write-ahead log used for server to commit changes before reply (safety).

• Employs group commits.

Page 20: Speculative Execution

Testing Setup

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

• 2 Dell machines, one client, one server• RedHat Linux.

• Routes packets through NISTnet emulator to introduce delay.• 0ms & 15ms

• All connected through 100 Mb/s ethernet.

Page 21: Speculative Execution

PostMarkSpeculative Execution in a Distributed File SystemEdmund B. Nightingale, Peter M. Chen, and Jason Flinn

Page 22: Speculative Execution

ApacheSpeculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

Page 23: Speculative Execution

Group Commits and Propagation effect

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

Page 24: Speculative Execution

Group Commits and Propagation effect

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

Page 25: Speculative Execution

Group Commits and Propagation effect

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

Page 26: Speculative Execution

Group Commits and Propagation effect

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

Page 27: Speculative Execution

Group Commits and Propagation effect

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

Page 28: Speculative Execution

Discussion

Speculative Execution in a Distributed File System Edmund B. Nightingale, Peter M. Chen, and Jason Flinn

• What other Apps can benefit from a Speculator?• Self-driving cars, text editor, …

• What security risks does Speculator introduce?• Malicious speculative actions could down your system?

• Uses today?• Computer architecture (branch prediction, pre-fetching, …)

• Hadoop uses for slow tasks.