HackerTube
HomeLongsLikedHistoryWatch laterCategoriesPlaylistsSettings

"Testing Distributed Systems w/ Deterministic Simulation" by Will Wilson

Strange Loop Conference12 HN recommenders · recommended in 11 months, 2014-2024
YouTube
55K views · 12 years ago · talk · evergreen

Will Wilson of FoundationDB explains how the team tested their distributed database using deterministic simulation. By running the whole system in a simulator with injected faults and reproducible seeds, they could find rare concurrency and network bugs.

HN treats it as the canonical talk on simulation testing and a mind-blowing example of how far rigorous testing can go.

Distributed systemsTesting, debugging & developer toolsDatabases & storage#deterministicsimulation#foundationdb#faultinjection#concurrencybugs#strangeloop

20 comments from Hacker News

@merqurio2024 · in “7 Databases in 7 Weeks for 2025”

FondationDB is such an incredible resource, but it’s so hard to access for the general public. It’s no wonder so few people know about it. I’ve always thought that if there were easier ways to interact with it, or some dev-friendly layers built on top (or public) it would become way more popular. it has shown how well it scales with Apple and snowflake, but is not an obvious choice for non-internet scale applications. If you don't know about FDB; there's an amazing video about how they test it that really got me into learning more: ▶ this video

RecommendsView on HN
@bobnamob2024 · in “Jepsen: Bufstream 0.1”

> We would like to combine Jepsen’s workload generation and history checking with Antithesis’ deterministic and replayable environment to make our tests more reproducible. For those unaware, Antithesis was founded by some of the folks who worked on FoundationDB - see ▶ this video for some of their handiwork. A Jepsen + Antithesis team up is something the world needs right now, specifically on the back of the Horizon Post Office scandal. Thanks for all your work highlighting the importance of db safety Aphyr

CitesView on HN
@georgelyon2023 · in “Swift as C++ Successor in FoundationDB [video]”

The great thing about FDB is that they have a testing infrastructure that is unlike any other database: ▶ this video If there is a Swift compiler bug that causes data loss I will bet money they will catch it (I will also bet they will find at least one Swift compiler bug)

RecommendsView on HN
@LAC-Tech2023 · in “How FoundationDB works and why it works”

"FDB can tolerate f failures with only f+1 replicas." Wait a minute, I know that formula... Viewstamped Replication?? I need to read the foundation DB paper. (I mainly read CRDT stuff so hopefully it's understandable). --- In general I'm really impressed foundation DB folks. The talk "Testing Distributed Systems w/ Deterministic Simulation" by Will Wilson blew my mind. TL;DR they spent the majority of their initial dev effort into making a simulation of the database, then when they were happy with that plugged in real storage, time and networks at the end. Well worth a watch for anyone interested in distributed systems & reliability. ▶ this video

Strongly recommendsView on HN
@jrvarela562023 · in “How FoundationDB works and why it works”

Tangent about FoundationDB: this is a great video that explains how the team tested it ▶ this video Spoiler: they even had their own custom power supplies used to test against power failures.

RecommendsView on HN
@arohner2023 · in “Griffin - A fully-regulated, API-driven bank, with Clojure”

It is a tall order, but but it's doable. The most important thing is to reduce the surface area of your application. Our business logic is almost entirely pure. The 'procs' have no side effects, except for things that happen on the other side of a clojure protocol (java interface). That means all side effects can be stubbed out during tests. Our "user" code has no access to threading libraries. Threading happens in "kernel" code. Watch ▶ this video for a good example of how this has already been done in practice.

RecommendsView on HN
@leetrout2023 · in “FoundationDB: A Distributed Key-Value Store”

What always fascinated me is they built the simulator for the database first(ish) and relied on it as a first class citizen while building the DB: ▶ this video > We wanted FoundationDB to survive failures of machines, networks, disks, clocks, racks, data centers, file systems, etc., so we created a simulation framework closely tied to Flow. By replacing physical interfaces with shims, replacing the main epoll-based run loop with a time-based simulation, and running multiple logical processes as concurrent Flow Actors, Simulation is able to conduct a deterministic simulation of an entire FoundationDB cluster within a single-thread! Even better, we are able to execute this simulation in a deterministic way, enabling us to reproduce problems and add instrumentation ex post facto. This incredible capability enabled us to build FoundationDB exclusively in simulation for the first 18 months and ensure exceptional fault tolerance long before it sent its first real network packet. For a database with as strong a contract as the FoundationDB, testing is crucial, and over the years we have run the equivalent of a trillion CPU-hours of simulated stress testing. link

CitesView on HN
@andrewflnr2022 · in “Accidentally making a language, for an engine, for a game”

AHA! I should have known that generation-reference business was intended for games all along. Reminds me of the time the FoundationDB team wrote a compiler to write a simulator to test their database: ▶ this video

CitesView on HN
@philovivero2022 · in “FoundationDB: A distributed unbundled transactional key value store”

I was watching the old 2014 video: ▶ this video I've included the timestamp of the relevant bit. He is talking about swizzling, which is like clogging++. He says they take a subset of the network connections, and have them timeout, but then bring them all back in reverse order, and that this somehow exposes far more bugs than other methods. This seems like a very interesting "well, that's funny!" moment that might lead to understanding something foundational about how distributed systems fail. Does anyone have more insight on this?

CitesView on HN
@dangerlibrary2021 · in “Software engineering research is a train wreck”

The FoundationDB team took a different approach, that I found pretty interesting. They created a fully deterministic (single threaded) simulation of a distributed database, and then use that simulation to test their implementation of the database under difference scenarios. They'd probably be interested in something like what you describe, as the bulk of their work seems to be rooting out and squashing bugs caused by factors out of their control (dropped connections, etc.) ▶ this video

CitesView on HN
@sgk2842021 · in “FoundationDB: A distributed, unbundled, transactional key value store [pdf]”

Here's another excellent talk at Strangeloop on FoundationDB's simulation testing by Will Wilson in 2014: ▶ this video

Strongly recommendsView on HN
@inaseer2020 · in “Even in Go, concurrency is still not easy”

Neat to learn about thread sanitizer. It sounds similar to another tool from Microsoft Research called Torch ( link ) which automatically instruments binaries to detect data races. Coyote is similar in some ways but different in others. Coyote serializes the execution of the entire program (running one task at a time), exploring one set of interleavings and then rewinding, and then exploring another set of interleavings, hoping to hit hard-to-find safety and liveness bugs. In addition to finding concurrency bugs in one isolated process, we use it to find bugs in our distributed system by effectively running our entire distributed system in one process and having Coyote explore the various states our system can be in. It sounded mind-boggingly cool when I first came across this way of testing distributed systems through Foundation DB ( ▶ this video we're emulating this kind of testing in our distributed system through Coyote. And unlike Foundation DB which had to develop their own variant of C++ to be able to do this kind of testing (kudos to them for doing it), Coyote allows us to do it on regular C# programs written using async/await asynchrony and benefit from decades of Microsoft Research in exploring large state spaces effectively.

CitesView on HN
@drej2020 · in “Challenges with distributed systems”

There is a great talk about this testing, it goes all the way to deterministic seeds and other basics. The level of determinism is admirable. ▶ this video

RecommendsView on HN
@nickpsecurity2019 · in “GitHub Outage Currently Ongoing – Issues, PRs, Notifications”

Their development velocity might have been due to their management or internal culture. You can get most of those results faster and on a budget. The best evidence was the startup behind FoundationDB continually improving their product in highly-competitive space while doing QA like this: ▶ this video Generally, on top of code reviews, one can get high return with minimal labor and hardware with a combo of Design-by-Contract, contract/spec/property-based testing, low-F.P. static analysis, and fuzzing with contracts in as runtime checks. That's my default recommendation. In Github's case, they also might have access to both closed and open tools that Microsoft Research makes. MSR is awesome if you've never checked them out. Two examples applicable to system reliability and security: link link Plus some of their other tools in various states of usability: link

CitesView on HN
@rubyn00bie2018 · in “FoundationDB Document Layer”

Soooo stoked. This should make futzing with it to get started a lot easier. I've been thinking about going to the FoundationDB summit to hopefully learn more... Does anyone have any good resources for learning about it? I've tried a few times but find the documentation a bit hard to grok. Maybe I'm just slow. Also if you haven't seen it, this is one of the most amazing talks on distributed systems (because it's about testing them) I've ever seen (by Will Wilson from FoundationDB pre-Apple merger): ▶ this video Truly mind blowing how good FoundationDB is supposed to be for its use cases, and this Mongo layer is just the business when it comes to helping adoption.

Strongly recommendsView on HN
@StreamBright2018 · in “CrimsonDB: A Self-Designing Key-Value Store”

>>> But for the Web site for my startup, early on it was clear that I needed a good key-value store as a Web user session state store (server). So, I designed one, coded it up, and have been using it. It seems to work fine. Well depending on what error scenarios you might run into your code will work until it runs into those scenarios. Few ideas what could go wrong you can get from this video: ▶ this video

RecommendsView on HN
@chubot2018 · in “The Problem with Threads (2006) [pdf]”

This talk was about Foundation DB was brought up recently, and it's pretty amazing. I recommend watching the whole thing, but to be brief they are taming the "infinite interleavings" problem through determinism. "Testing Distributed Systems w/ Deterministic Simulation" by Will Wilson ▶ this video They wrote an interesting Actor DSL that compiles to C++ and is completely deterministic, and they torture this deterministic engine with generated test cases on a cluster every night. I guess you could say that the whole cluster is necessarily non-deterministic, but an individual node is deterministic, given an ordering of the messages it receives.

Strongly recommendsView on HN
@Smerity2015 · in “Fuzzing Raft for Fun and Publication”

I'm very excited by this work. As they say, testing for distributed systems leaves a great deal to be desired, but there work is a great step! I was excited for FoundationDB, who put a great deal of focus on testing[1], but they were acquired into mystery by Apple. To give you an idea of how well tested they were, Aphyr of "Call Me Maybe" fame didn't test them "because their testing appears to be waaaay more rigorous than mine"[2]. FoundationDB ran Jepsen internally anyway[3]. DEMi is a really nice tool that has me excited. I've worked with similar test systems for non-blocking IO models and they're hugely useful. For non-blocking IO, you can artificially accelerate time as you can leap to the next interrupt, speeding up fuzzing substantially (see: Flow from FoundationDB in [1]). @ikneaddough, the demi-applications repo notes Spark, have you tested it so far? I quite like Spark but had some very temperamental issues at scale. [1]: ▶ this video [2]: link [3]: link

CitesView on HN
@teeray2015 · in “Apple Acquires FoundationDB”

One of their engineers gave a great talk at Strangeloop ( ▶ this video ) that shows some of the amazing simulations they ran FoundationDB through. It's well worth a watch if you want to understand the punishment that they put this database through to make it stand out.

Strongly recommendsView on HN
@itp2014 · in “Databases at 14.4Mhz”

I'll give you some brief thoughts from my experience working at FoundationDB, but if you really want the in-depth answer to what makes our simulation framework an enabling technology for everything we do, you should take a look at the talk my colleague Will Wilson gave at Strange Loop [0]. Everything in our core is written in Flow, our asynchronous programming environment. The architecture of our server is essentially single threaded, with (pseudo-)concurrent actors allowing a single process to satisfy multiple roles at once. The interfaces that these actors use to communicate -- with the disk, over the network, with the OS in general -- are abstracted and implemented in Flow as well. Each of these interfaces not only has at least one "real" implementation, but at least one, and sometimes more, simulated implementations. Since we run multiple actors in a single process all the time, running yet more actors, pretending to be different machines, all still in the same process, was an obvious step. These workers communicate with each other via the _same_ network interfaces that real-world workers do in real clusters. In the end we are able to become our own adversaries, pushing the limits of the system in ways that just don't happen often enough in the real world to test and debug in the wild. Our simulated implementations are allowed to present any behavior that can be observed in the real world, or justified by the spec, or implied by the contract. And they can do so much more

RecommendsView on HN
Autonomous Testing and the Future of Software Development - Will Wilson32:02

Autonomous Testing and the Future of Software Development - Will Wilson

The Linux Foundation
7K views • 7 years ago
"Tackling Concurrency Bugs with TLA+" by Hillel Wayne30:06

"Tackling Concurrency Bugs with TLA+" by Hillel Wayne

Strange Loop Conference
24K views • 9 years ago
"Systems that run forever self-heal and scale" by Joe Armstrong (2013)1:10:23

"Systems that run forever self-heal and scale" by Joe Armstrong (2013)

Strange Loop Conference
85K views • 5 years ago
"I See What You Mean" by Peter Alvaro52:29

"I See What You Mean" by Peter Alvaro

Strange Loop Conference
59K views • 11 years ago
"Transactions: myths, surprises and opportunities" by Martin Kleppmann41:08

"Transactions: myths, surprises and opportunities" by Martin Kleppmann

Strange Loop Conference
84K views • 11 years ago
"Finding bugs without running or even looking at code" by Jay Parlar40:27

"Finding bugs without running or even looking at code" by Jay Parlar

Strange Loop Conference
42K views • 7 years ago
Lecture 1: Introduction1:19:35

Lecture 1: Introduction

MIT 6.824: Distributed Systems
921K views • 6 years ago
"Stop Rate Limiting! Capacity Management Done Right" by Jon Moore42:20

"Stop Rate Limiting! Capacity Management Done Right" by Jon Moore

Strange Loop Conference
41K views • 9 years ago
"Unison: a new distributed programming language" by Paul Chiusano41:06

"Unison: a new distributed programming language" by Paul Chiusano

Strange Loop Conference
45K views • 7 years ago
"Turning the database inside out with Apache Samza" by Martin Kleppmann47:43

"Turning the database inside out with Apache Samza" by Martin Kleppmann

Strange Loop Conference
205K views • 12 years ago
AWS re:Invent 2018: How AWS Minimizes the Blast Radius of Failures (ARC338)55:44

AWS re:Invent 2018: How AWS Minimizes the Blast Radius of Failures (ARC338)

Amazon Web Services
37K views • 7 years ago
Distributed Systems 1.1: Introduction14:36

Distributed Systems 1.1: Introduction

Martin Kleppmann
382K views • 6 years ago
🚀  TDD, Where Did It All Go Wrong (Ian Cooper)1:03:55

🚀 TDD, Where Did It All Go Wrong (Ian Cooper)

DevTernity Conference
619K views • 8 years ago
Liberating Distributed Consensus - Heidi Howard34:52

Liberating Distributed Consensus - Heidi Howard

Reactive Summit
7K views • 7 years ago
"Datafun: a functional query language" by Michael Arntzenius42:31

"Datafun: a functional query language" by Michael Arntzenius

Strange Loop Conference
9K views • 9 years ago
Raft lecture (Raft user study)58:17

Raft lecture (Raft user study)

Diego Ongaro
87K views • 13 years ago
"Stop Writing Dead Programs" by Jack Rusher (Strange Loop 2022)43:04

"Stop Writing Dead Programs" by Jack Rusher (Strange Loop 2022)

Strange Loop Conference
468K views • 4 years ago
Paxos lecture (Raft user study)1:06:34

Paxos lecture (Raft user study)

Diego Ongaro
114K views • 13 years ago
AWS re:Invent 2018: Amazon DynamoDB Under the Hood: How We Built a Hyper-Scale Database (DAT321)53:43

AWS re:Invent 2018: Amazon DynamoDB Under the Hood: How We Built a Hyper-Scale Database (DAT321)

Amazon Web Services
112K views • 7 years ago
AWS re:Invent 2014 | (SPOT302) Under the Covers of AWS: Its Core Distributed Systems46:15

AWS re:Invent 2014 | (SPOT302) Under the Covers of AWS: Its Core Distributed Systems

Amazon Web Services
10K views • 11 years ago