SlideShare a Scribd company logo
Deterministic Simulation 
Testing of Distributed Systems 
For Great Justice 
will.wilson@foundationdb.com 
@FoundationDB
2 
Debugging distributed 
systems is terrible
3 
First of all, distributed systems 
tend to be complicated… 
… but it’s worse than that
4 
Repeatability? Yeah, right
4 
Repeatability? Yeah, right 
A
4 
Repeatability? Yeah, right 
A 
A 
retry
4 
Repeatability? Yeah, right 
A 
A 
retry 
A
5 
Lack of repeatability is a special 
case of non-determinism
5 
Lack of repeatability is a special 
case of non-determinism 
A
5 
Lack of repeatability is a special 
case of non-determinism 
A 
B
5 
Lack of repeatability is a special 
case of non-determinism 
A A 
B
6 
FoundationDB is a distributed 
stateful system with ridiculously 
strong guarantees 
ACID!
7 
Don’t debug your system, 
debug a simulation instead.
8 
3 INGREDIENTS 
of deterministic simulation 
Single-threaded pseudo-concurrency 
Simulated implementation of all 
external communication 
Determinism 
1 
2 
3
Single-threaded 1 pseudo-concurrency 
9 
Flow 
! 
A syntactic extension to C++ , new keywords 
and actors, “compiled” down to regular C++ w/ 
callbacks
10 
ACTOR Future<float> asyncAdd(Future<float> f, ! 
! ! ! ! ! ! ! ! ! ! ! float offset) {! 
float value = wait( f );! 
return value + offset;! 
} 
Single-threaded 1 pseudo-concurrency
Single-threaded 1 pseudo-concurrency 
11 
class AsyncAddActor : public Actor, public FastAllocated<AsyncAddActor> { 
public: 
AsyncAddActor(Future<float> const& f,float const& offset) : Actor("AsyncAddActor"), 
f(f), 
offset(offset), 
ChooseGroupbody1W1_1(this, &ChooseGroupbody1W1) 
{ } 
Future<float> a_start() { 
actorReturnValue.setActorToCancel(this); 
auto f = actorReturnValue.getFuture(); 
a_body1(); 
return f; 
} 
private: // Implementation 
… 
}; 
! 
Future<float> asyncAdd( Future<float> const& f, float const& offset ) { 
return (new AsyncAddActor(f, offset))->a_start(); 
}
Single-threaded 1 pseudo-concurrency 
12 
int a_body1(int loopDepth=0) { 
try { 
ChooseGroupbody1W1_1.setFuture(f); 
loopDepth = a_body1alt1(loopDepth); 
} 
catch (Error& error) { 
loopDepth = a_body1Catch1(error, loopDepth); 
} catch (...) { 
loopDepth = a_body1Catch1(unknown_error(), loopDepth); 
} 
return loopDepth; 
} 
int a_body1cont1(float const& value,int loopDepth) { 
actorReturn(actorReturnValue, value + offset); 
return 0; 
} 
int a_body1when1(float const& value,int loopDepth) { 
loopDepth = a_body1cont1(value, loopDepth); 
return loopDepth; 
}
Single-threaded 1 pseudo-concurrency 
13 
template <class T, class V> 
void actorReturn(Promise<T>& actorReturnValue, V const& value) { 
T rval = value; // explicit copy, needed in the case the return is a state variable of the actor 
Promise<T> rv = std::move( actorReturnValue ); 
! 
// Break the ownership cycle this,this->actorReturnValue,this->actorReturnValue.sav,this- 
>actorReturnValue.sav->actorToCancel 
rv.clearActorToCancel(); 
try { 
delete this; 
} catch (...) { 
TraceEvent(SevError, "ActorDestructorError"); 
} 
rv.send( rval ); 
}
Single-threaded 1 pseudo-concurrency 
14 
Programming language 
Ruby (using threads) 
Ruby (using queues) 
Objective C (using threads) 
Java (using threads) 
Stackless Python 
Erlang 
Go 
Flow 
Time in seconds 
1990 sec 
360 sec 
26 sec 
12 sec 
1.68 sec 
1.09 sec 
0.87 sec 
0.075 sec
15 
Simulated 2 Implementation 
INetwork 
IConnection 
IAsyncFile 
… 
SimNetwork 
SimConnection 
SimFile 
…
16 
void connect( Reference<Sim2Conn> peer, NetworkAddress peerEndpoint ) { 
this->peer = peer; 
this->peerProcess = peer->process; 
this->peerId = peer->dbgid; 
this->peerEndpoint = peerEndpoint; 
! 
// Every one-way connection gets a random permanent latency and a random send buffer 
for the duration of the connection 
auto latency = g_clogging.setPairLatencyIfNotSet( peerProcess->address.ip, process- 
>address.ip, FLOW_KNOBS->MAX_CLOGGING_LATENCY*g_random->random01() ); 
sendBufSize = std::max<double>( g_random->randomInt(0, 5000000), 25e6 * (latency + .002) ); 
TraceEvent("Sim2Connection").detail("SendBufSize", sendBufSize).detail("Latency", latency); 
} 
Simulated 2 Implementation
17 
Simulated 2 Implementation 
ACTOR static Future<Void> receiver( Sim2Conn* self ) { 
loop { 
if (self->sentBytes.get() != self->receivedBytes.get()) 
Void _ = wait( g_simulator.onProcess( self->peerProcess ) ); 
while ( self->sentBytes.get() == self->receivedBytes.get() ) 
Void _ = wait( self->sentBytes.onChange() ); 
ASSERT( g_simulator.getCurrentProcess() == self->peerProcess ); 
state int64_t pos = g_random->random01() < .5 ? self->sentBytes.get() : g_random- 
>randomInt64( self->receivedBytes.get(), self->sentBytes.get()+1 ); 
Void _ = wait( delay( g_clogging.getSendDelay( self->process->address, self->peerProcess- 
>address ) ) ); 
Void _ = wait( g_simulator.onProcess( self->process ) ); 
ASSERT( g_simulator.getCurrentProcess() == self->process ); 
Void _ = wait( delay( g_clogging.getRecvDelay( self->process->address, self->peerProcess- 
>address ) ) ); 
ASSERT( g_simulator.getCurrentProcess() == self->process ); 
self->receivedBytes.set( pos ); 
Void _ = wait( Void() ); // Prior notification can delete self and cancel this actor 
ASSERT( g_simulator.getCurrentProcess() == self->process ); 
} 
}
18 
Simulated Implementation 
// Reads as many bytes as possible from the read buffer into [begin,end) and returns the number of 
bytes read (might be 0) 
// (or may throw an error if the connection dies) 
virtual int read( uint8_t* begin, uint8_t* end ) { 
rollRandomClose(); 
! 
int64_t avail = receivedBytes.get() - readBytes.get(); // SOMEDAY: random? 
int toRead = std::min<int64_t>( end-begin, avail ); 
ASSERT( toRead >= 0 && toRead <= recvBuf.size() && toRead <= end-begin ); 
for(int i=0; i<toRead; i++) 
begin[i] = recvBuf[i]; 
recvBuf.erase( recvBuf.begin(), recvBuf.begin() + toRead ); 
readBytes.set( readBytes.get() + toRead ); 
return toRead; 
} 
2
19 
Simulated Implementation 
void rollRandomClose() { 
if (g_simulator.enableConnectionFailures && g_random->random01() < .00001) { 
double a = g_random->random01(), b = g_random->random01(); 
TEST(true); // Simulated connection failure 
TraceEvent("ConnectionFailure", dbgid).detail("MyAddr", process- 
>address).detail("PeerAddr", peerProcess->address).detail("SendClosed", a > .33).detail("RecvClosed", 
a < .66).detail("Explicit", b < .3); 
if (a < .66 && peer) peer->closeInternal(); 
if (a > .33) closeInternal(); 
// At the moment, we occasionally notice the connection failed immediately. In 
principle, this could happen but only after a delay. 
if (b < .3) 
throw connection_failed(); 
} 
} 
2
20 
3 Determinism 
We have (1) and (2), so all we need to add is 
none of the control flow of anything in your 
program depending on anything outside of 
your program + its inputs.
21 
3 Determinism 
Use unseeds to figure out whether what 
happened was deterministic
22 
1 + 2 + 3 
The Simulator
23 
Test files 
testTitle=SwizzledCycleTest 
testName=Cycle 
transactionsPerSecond=1000.0 
testDuration=30.0 
expectedRate=0.01 
! 
testName=RandomClogging 
testDuration=30.0 
swizzle = 1 
! 
testName=Attrition 
machinesToKill=10 
machinesToLeave=3 
reboot=true 
testDuration=30.0 
! 
testName=ChangeConfig 
maxDelayBeforeChange=30.0 
coordinators=auto
24 
Other Simulated disasters 
In parallel with the workloads, we run 
some other things like: 
! 
• broken machine 
• clogging 
• swizzling 
• nukes 
• dumb sysadmin 
• etc.
25 
You are looking for bugs… 
the universe is also 
looking for bugs 
How can you make your 
CPUs more efficient than 
the universe’s?
26 
1. Disasters here happen 
more frequently than in 
the real world
27 
2. Buggify! 
if (BUGGIFY) toSend = std::min(toSend, g_random->randomInt(0, 1000)); 
! 
when( Void _ = wait( BUGGIFY ? Never() : delay( g_network->isSimulated() ? 20 : 
900 ) ) ) { 
req.reply.sendError( timed_out() ); 
}
28 
3. The Hurst exponent
29 
3. The Hurst exponent
30 
3. The Hurst exponent
31 
We estimate we’ve 
run the equivalent of 
trillions of hours 
of “real world” tests
32 
BAD NEWS: 
! 
We broke debugging (but at least it’s 
possible)
33 
Backup: Sinkhole
34 
Two “bugs” found by Sinkhole 
1. Power safety bug in ZK 
2. Linux package managers writing 
conf files don’t sync
35 
Future directions 
1. Dedicated “red team” 
2. More hardware 
3. Try to catch bugs that “evolve” 
4. More real world testing
Questions? 
will.wilson@foundationdb.com 
@willwilsonFDB
Data Partitioning 
Keyspace is partitioned onto different 
machines for scalability
Data Replication 
The same keys are copied onto different 
machines for fault tolerance
FoundationDB 
Partitioning + replication for both scalability and fault 
tolerance
Architecture of FoundationDB
Transaction Processing 
• Decompose the transaction processing pipeline 
into stages 
• Each stage is distributed
Pipeline Stages 
• Accept client transactions 
• Apply conflict checking 
• Write to transaction logs 
• Update persistent data structures 
High Performance!
Performance Results 
• 24 machine cluster 
• 100% cross-node transactions 
• Saturates its SSDs 
890,000 ops/sec
Scalability Results 
Performance by cluster size
Ad

More Related Content

What's hot (20)

Stream processing using Kafka
Stream processing using KafkaStream processing using Kafka
Stream processing using Kafka
Knoldus Inc.
 
RocksDB detail
RocksDB detailRocksDB detail
RocksDB detail
MIJIN AN
 
Tech Talk: RocksDB Slides by Dhruba Borthakur & Haobo Xu of Facebook
Tech Talk: RocksDB Slides by Dhruba Borthakur & Haobo Xu of FacebookTech Talk: RocksDB Slides by Dhruba Borthakur & Haobo Xu of Facebook
Tech Talk: RocksDB Slides by Dhruba Borthakur & Haobo Xu of Facebook
The Hive
 
Advanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan Ewen
Advanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan EwenAdvanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan Ewen
Advanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan Ewen
confluent
 
Best Practice in Accelerating Data Applications with Spark+Alluxio
Best Practice in Accelerating Data Applications with Spark+AlluxioBest Practice in Accelerating Data Applications with Spark+Alluxio
Best Practice in Accelerating Data Applications with Spark+Alluxio
Alluxio, Inc.
 
Four Things to Know About Reliable Spark Streaming with Typesafe and Databricks
Four Things to Know About Reliable Spark Streaming with Typesafe and DatabricksFour Things to Know About Reliable Spark Streaming with Typesafe and Databricks
Four Things to Know About Reliable Spark Streaming with Typesafe and Databricks
Legacy Typesafe (now Lightbend)
 
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
confluent
 
Introduction to the Disruptor
Introduction to the DisruptorIntroduction to the Disruptor
Introduction to the Disruptor
Trisha Gee
 
Fluentd 101
Fluentd 101Fluentd 101
Fluentd 101
SATOSHI TAGOMORI
 
Saturn 2018: Managing data consistency in a microservice architecture using S...
Saturn 2018: Managing data consistency in a microservice architecture using S...Saturn 2018: Managing data consistency in a microservice architecture using S...
Saturn 2018: Managing data consistency in a microservice architecture using S...
Chris Richardson
 
Kafka replication apachecon_2013
Kafka replication apachecon_2013Kafka replication apachecon_2013
Kafka replication apachecon_2013
Jun Rao
 
The Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization OpportunitiesThe Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization Opportunities
Databricks
 
Spark streaming
Spark streamingSpark streaming
Spark streaming
Whiteklay
 
JPA Week3 Entity Mapping / Hexagonal Architecture
JPA Week3 Entity Mapping / Hexagonal ArchitectureJPA Week3 Entity Mapping / Hexagonal Architecture
JPA Week3 Entity Mapping / Hexagonal Architecture
Covenant Ko
 
Demystifying flink memory allocation and tuning - Roshan Naik, Uber
Demystifying flink memory allocation and tuning - Roshan Naik, UberDemystifying flink memory allocation and tuning - Roshan Naik, Uber
Demystifying flink memory allocation and tuning - Roshan Naik, Uber
Flink Forward
 
Flink and NiFi, Two Stars in the Apache Big Data Constellation
Flink and NiFi, Two Stars in the Apache Big Data ConstellationFlink and NiFi, Two Stars in the Apache Big Data Constellation
Flink and NiFi, Two Stars in the Apache Big Data Constellation
Matthew Ring
 
[236] 카카오의데이터파이프라인 윤도영
[236] 카카오의데이터파이프라인 윤도영[236] 카카오의데이터파이프라인 윤도영
[236] 카카오의데이터파이프라인 윤도영
NAVER D2
 
Intro To MongoDB
Intro To MongoDBIntro To MongoDB
Intro To MongoDB
Alex Sharp
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
Dvir Volk
 
Apache Kafka in the Insurance Industry
Apache Kafka in the Insurance IndustryApache Kafka in the Insurance Industry
Apache Kafka in the Insurance Industry
Kai Wähner
 
Stream processing using Kafka
Stream processing using KafkaStream processing using Kafka
Stream processing using Kafka
Knoldus Inc.
 
RocksDB detail
RocksDB detailRocksDB detail
RocksDB detail
MIJIN AN
 
Tech Talk: RocksDB Slides by Dhruba Borthakur & Haobo Xu of Facebook
Tech Talk: RocksDB Slides by Dhruba Borthakur & Haobo Xu of FacebookTech Talk: RocksDB Slides by Dhruba Borthakur & Haobo Xu of Facebook
Tech Talk: RocksDB Slides by Dhruba Borthakur & Haobo Xu of Facebook
The Hive
 
Advanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan Ewen
Advanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan EwenAdvanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan Ewen
Advanced Streaming Analytics with Apache Flink and Apache Kafka, Stephan Ewen
confluent
 
Best Practice in Accelerating Data Applications with Spark+Alluxio
Best Practice in Accelerating Data Applications with Spark+AlluxioBest Practice in Accelerating Data Applications with Spark+Alluxio
Best Practice in Accelerating Data Applications with Spark+Alluxio
Alluxio, Inc.
 
Four Things to Know About Reliable Spark Streaming with Typesafe and Databricks
Four Things to Know About Reliable Spark Streaming with Typesafe and DatabricksFour Things to Know About Reliable Spark Streaming with Typesafe and Databricks
Four Things to Know About Reliable Spark Streaming with Typesafe and Databricks
Legacy Typesafe (now Lightbend)
 
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
Confluent Workshop Series: ksqlDB로 스트리밍 앱 빌드
confluent
 
Introduction to the Disruptor
Introduction to the DisruptorIntroduction to the Disruptor
Introduction to the Disruptor
Trisha Gee
 
Saturn 2018: Managing data consistency in a microservice architecture using S...
Saturn 2018: Managing data consistency in a microservice architecture using S...Saturn 2018: Managing data consistency in a microservice architecture using S...
Saturn 2018: Managing data consistency in a microservice architecture using S...
Chris Richardson
 
Kafka replication apachecon_2013
Kafka replication apachecon_2013Kafka replication apachecon_2013
Kafka replication apachecon_2013
Jun Rao
 
The Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization OpportunitiesThe Parquet Format and Performance Optimization Opportunities
The Parquet Format and Performance Optimization Opportunities
Databricks
 
Spark streaming
Spark streamingSpark streaming
Spark streaming
Whiteklay
 
JPA Week3 Entity Mapping / Hexagonal Architecture
JPA Week3 Entity Mapping / Hexagonal ArchitectureJPA Week3 Entity Mapping / Hexagonal Architecture
JPA Week3 Entity Mapping / Hexagonal Architecture
Covenant Ko
 
Demystifying flink memory allocation and tuning - Roshan Naik, Uber
Demystifying flink memory allocation and tuning - Roshan Naik, UberDemystifying flink memory allocation and tuning - Roshan Naik, Uber
Demystifying flink memory allocation and tuning - Roshan Naik, Uber
Flink Forward
 
Flink and NiFi, Two Stars in the Apache Big Data Constellation
Flink and NiFi, Two Stars in the Apache Big Data ConstellationFlink and NiFi, Two Stars in the Apache Big Data Constellation
Flink and NiFi, Two Stars in the Apache Big Data Constellation
Matthew Ring
 
[236] 카카오의데이터파이프라인 윤도영
[236] 카카오의데이터파이프라인 윤도영[236] 카카오의데이터파이프라인 윤도영
[236] 카카오의데이터파이프라인 윤도영
NAVER D2
 
Intro To MongoDB
Intro To MongoDBIntro To MongoDB
Intro To MongoDB
Alex Sharp
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
Dvir Volk
 
Apache Kafka in the Insurance Industry
Apache Kafka in the Insurance IndustryApache Kafka in the Insurance Industry
Apache Kafka in the Insurance Industry
Kai Wähner
 

Viewers also liked (13)

Load balancing theory and practice
Load balancing theory and practiceLoad balancing theory and practice
Load balancing theory and practice
FoundationDB
 
NoSQL and ACID
NoSQL and ACIDNoSQL and ACID
NoSQL and ACID
FoundationDB
 
Building FoundationDB
Building FoundationDBBuilding FoundationDB
Building FoundationDB
FoundationDB
 
FoundationDB - NoSQL and ACID
FoundationDB - NoSQL and ACIDFoundationDB - NoSQL and ACID
FoundationDB - NoSQL and ACID
inside-BigData.com
 
Estacion los angeles
Estacion los angelesEstacion los angeles
Estacion los angeles
JAIME JIPSION
 
Simple past lesson
Simple past lesson Simple past lesson
Simple past lesson
Christian Alape
 
My Trip Through Australia
My Trip Through AustraliaMy Trip Through Australia
My Trip Through Australia
deankathryn
 
рождественский вертеп
рождественский вертепрождественский вертеп
рождественский вертеп
Tatiana Tretiakova
 
Nosql databases
Nosql databasesNosql databases
Nosql databases
ateeq ateeq
 
Distributed computing
Distributed computingDistributed computing
Distributed computing
Alokeparna Choudhury
 
ACID vs BASE in NoSQL: Another False Dichotomy
ACID vs BASE in NoSQL: Another False DichotomyACID vs BASE in NoSQL: Another False Dichotomy
ACID vs BASE in NoSQL: Another False Dichotomy
Dan Sullivan, Ph.D.
 
Load balancing theory and practice
Load balancing theory and practiceLoad balancing theory and practice
Load balancing theory and practice
FoundationDB
 
Building FoundationDB
Building FoundationDBBuilding FoundationDB
Building FoundationDB
FoundationDB
 
Estacion los angeles
Estacion los angelesEstacion los angeles
Estacion los angeles
JAIME JIPSION
 
My Trip Through Australia
My Trip Through AustraliaMy Trip Through Australia
My Trip Through Australia
deankathryn
 
рождественский вертеп
рождественский вертепрождественский вертеп
рождественский вертеп
Tatiana Tretiakova
 
ACID vs BASE in NoSQL: Another False Dichotomy
ACID vs BASE in NoSQL: Another False DichotomyACID vs BASE in NoSQL: Another False Dichotomy
ACID vs BASE in NoSQL: Another False Dichotomy
Dan Sullivan, Ph.D.
 
Ad

Similar to Deterministic simulation testing (20)

Node.js System: The Landing
Node.js System: The LandingNode.js System: The Landing
Node.js System: The Landing
Haci Murat Yaman
 
To Err Is Human
To Err Is HumanTo Err Is Human
To Err Is Human
Alex Liu
 
Frege - consequently functional programming for the JVM
Frege - consequently functional programming for the JVMFrege - consequently functional programming for the JVM
Frege - consequently functional programming for the JVM
Dierk König
 
The Ring programming language version 1.5.3 book - Part 89 of 184
The Ring programming language version 1.5.3 book - Part 89 of 184The Ring programming language version 1.5.3 book - Part 89 of 184
The Ring programming language version 1.5.3 book - Part 89 of 184
Mahmoud Samir Fayed
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?
Doug Hawkins
 
Bytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreterBytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreter
akaptur
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM Mechanics
Azul Systems, Inc.
 
COSCUP: Introduction to Julia
COSCUP: Introduction to JuliaCOSCUP: Introduction to Julia
COSCUP: Introduction to Julia
岳華 杜
 
clegoues-pwlconf-sept16-asPDF.pdf
clegoues-pwlconf-sept16-asPDF.pdfclegoues-pwlconf-sept16-asPDF.pdf
clegoues-pwlconf-sept16-asPDF.pdf
aoecmtin
 
Windbg랑 친해지기
Windbg랑 친해지기Windbg랑 친해지기
Windbg랑 친해지기
Ji Hun Kim
 
ssh.isdn.test
ssh.isdn.testssh.isdn.test
ssh.isdn.test
Chris Hallman
 
掀起 Swift 的面紗
掀起 Swift 的面紗掀起 Swift 的面紗
掀起 Swift 的面紗
Pofat Tseng
 
Ten useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesTen useful JavaScript tips & best practices
Ten useful JavaScript tips & best practices
Ankit Rastogi
 
From Node.js to Design Patterns - BuildPiper
From Node.js to Design Patterns - BuildPiperFrom Node.js to Design Patterns - BuildPiper
From Node.js to Design Patterns - BuildPiper
Luciano Mammino
 
Priming Java for Speed at Market Open
Priming Java for Speed at Market OpenPriming Java for Speed at Market Open
Priming Java for Speed at Market Open
Azul Systems Inc.
 
Introduction to julia
Introduction to juliaIntroduction to julia
Introduction to julia
岳華 杜
 
How to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJITHow to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJIT
Egor Bogatov
 
"Quantum" performance effects
"Quantum" performance effects"Quantum" performance effects
"Quantum" performance effects
Sergey Kuksenko
 
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMockUnit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
Robot Media
 
Rich and Snappy Apps (No Scaling Required)
Rich and Snappy Apps (No Scaling Required)Rich and Snappy Apps (No Scaling Required)
Rich and Snappy Apps (No Scaling Required)
Thomas Fuchs
 
Node.js System: The Landing
Node.js System: The LandingNode.js System: The Landing
Node.js System: The Landing
Haci Murat Yaman
 
To Err Is Human
To Err Is HumanTo Err Is Human
To Err Is Human
Alex Liu
 
Frege - consequently functional programming for the JVM
Frege - consequently functional programming for the JVMFrege - consequently functional programming for the JVM
Frege - consequently functional programming for the JVM
Dierk König
 
The Ring programming language version 1.5.3 book - Part 89 of 184
The Ring programming language version 1.5.3 book - Part 89 of 184The Ring programming language version 1.5.3 book - Part 89 of 184
The Ring programming language version 1.5.3 book - Part 89 of 184
Mahmoud Samir Fayed
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?
Doug Hawkins
 
Bytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreterBytes in the Machine: Inside the CPython interpreter
Bytes in the Machine: Inside the CPython interpreter
akaptur
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM Mechanics
Azul Systems, Inc.
 
COSCUP: Introduction to Julia
COSCUP: Introduction to JuliaCOSCUP: Introduction to Julia
COSCUP: Introduction to Julia
岳華 杜
 
clegoues-pwlconf-sept16-asPDF.pdf
clegoues-pwlconf-sept16-asPDF.pdfclegoues-pwlconf-sept16-asPDF.pdf
clegoues-pwlconf-sept16-asPDF.pdf
aoecmtin
 
Windbg랑 친해지기
Windbg랑 친해지기Windbg랑 친해지기
Windbg랑 친해지기
Ji Hun Kim
 
掀起 Swift 的面紗
掀起 Swift 的面紗掀起 Swift 的面紗
掀起 Swift 的面紗
Pofat Tseng
 
Ten useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesTen useful JavaScript tips & best practices
Ten useful JavaScript tips & best practices
Ankit Rastogi
 
From Node.js to Design Patterns - BuildPiper
From Node.js to Design Patterns - BuildPiperFrom Node.js to Design Patterns - BuildPiper
From Node.js to Design Patterns - BuildPiper
Luciano Mammino
 
Priming Java for Speed at Market Open
Priming Java for Speed at Market OpenPriming Java for Speed at Market Open
Priming Java for Speed at Market Open
Azul Systems Inc.
 
Introduction to julia
Introduction to juliaIntroduction to julia
Introduction to julia
岳華 杜
 
How to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJITHow to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJIT
Egor Bogatov
 
"Quantum" performance effects
"Quantum" performance effects"Quantum" performance effects
"Quantum" performance effects
Sergey Kuksenko
 
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMockUnit testing in iOS featuring OCUnit, GHUnit & OCMock
Unit testing in iOS featuring OCUnit, GHUnit & OCMock
Robot Media
 
Rich and Snappy Apps (No Scaling Required)
Rich and Snappy Apps (No Scaling Required)Rich and Snappy Apps (No Scaling Required)
Rich and Snappy Apps (No Scaling Required)
Thomas Fuchs
 
Ad

Recently uploaded (20)

GCF - Master Presentation Buyside - UK - 0525 - GCF.pdf
GCF - Master Presentation Buyside - UK - 0525 - GCF.pdfGCF - Master Presentation Buyside - UK - 0525 - GCF.pdf
GCF - Master Presentation Buyside - UK - 0525 - GCF.pdf
hkmd5mqzjb
 
VSLA Methodology Training 2024 - Copy.ppt
VSLA Methodology Training 2024 - Copy.pptVSLA Methodology Training 2024 - Copy.ppt
VSLA Methodology Training 2024 - Copy.ppt
wodajodagim
 
An indepth study of behavioral finances.
An indepth study of behavioral finances.An indepth study of behavioral finances.
An indepth study of behavioral finances.
Khushboo Dange
 
2025-05-08 - Torex Gold - Corporate Presentation - May 2025.pdf
2025-05-08 - Torex Gold - Corporate Presentation - May 2025.pdf2025-05-08 - Torex Gold - Corporate Presentation - May 2025.pdf
2025-05-08 - Torex Gold - Corporate Presentation - May 2025.pdf
Adnet Communications
 
GCF - Our added Value in Transport & Logistics sector
GCF - Our added Value in Transport & Logistics sectorGCF - Our added Value in Transport & Logistics sector
GCF - Our added Value in Transport & Logistics sector
dpioux
 
Моніторинг ІТ сектору України GET_UKR_PB_03_2025-1.pdf
Моніторинг ІТ сектору України GET_UKR_PB_03_2025-1.pdfМоніторинг ІТ сектору України GET_UKR_PB_03_2025-1.pdf
Моніторинг ІТ сектору України GET_UKR_PB_03_2025-1.pdf
Інститут економічних досліджень та політичних консультацій
 
Our added value in Software & financial services sector 0525.pdf
Our added value in Software & financial services sector 0525.pdfOur added value in Software & financial services sector 0525.pdf
Our added value in Software & financial services sector 0525.pdf
dianepioux1
 
Trumps-Tariffs-and-UK-Pensions-7.5.25.pdf
Trumps-Tariffs-and-UK-Pensions-7.5.25.pdfTrumps-Tariffs-and-UK-Pensions-7.5.25.pdf
Trumps-Tariffs-and-UK-Pensions-7.5.25.pdf
Henry Tapper
 
GCF- our added value in the industry sector 052025.pdf
GCF- our added value in the industry sector 052025.pdfGCF- our added value in the industry sector 052025.pdf
GCF- our added value in the industry sector 052025.pdf
dianepioux1
 
Ethereum's Market Value Soars Through JQRBT-Level Growth, Overtaking Major Co...
Ethereum's Market Value Soars Through JQRBT-Level Growth, Overtaking Major Co...Ethereum's Market Value Soars Through JQRBT-Level Growth, Overtaking Major Co...
Ethereum's Market Value Soars Through JQRBT-Level Growth, Overtaking Major Co...
jqrbt
 
Telegraph - 'Rachel Reeves paves way for Dutch-style pensions' May 2025.docx
Telegraph - 'Rachel Reeves paves way for Dutch-style pensions' May 2025.docxTelegraph - 'Rachel Reeves paves way for Dutch-style pensions' May 2025.docx
Telegraph - 'Rachel Reeves paves way for Dutch-style pensions' May 2025.docx
Henry Tapper
 
WRN_Investor_Presentation_May 2025 Update.pdf
WRN_Investor_Presentation_May 2025 Update.pdfWRN_Investor_Presentation_May 2025 Update.pdf
WRN_Investor_Presentation_May 2025 Update.pdf
cmagee4
 
Mastering Crypto Security: How GXCYPX Solutions Help Prevent Social Engineeri...
Mastering Crypto Security: How GXCYPX Solutions Help Prevent Social Engineeri...Mastering Crypto Security: How GXCYPX Solutions Help Prevent Social Engineeri...
Mastering Crypto Security: How GXCYPX Solutions Help Prevent Social Engineeri...
gxcypx
 
Telegraph - 'Rachel Reeves paves way for Dutch-style pensions' May 2025 2.docx
Telegraph - 'Rachel Reeves paves way for Dutch-style pensions' May 2025 2.docxTelegraph - 'Rachel Reeves paves way for Dutch-style pensions' May 2025 2.docx
Telegraph - 'Rachel Reeves paves way for Dutch-style pensions' May 2025 2.docx
Henry Tapper
 
Lundin Gold Corporate Presentation - May 2025
Lundin Gold Corporate Presentation -  May 2025Lundin Gold Corporate Presentation -  May 2025
Lundin Gold Corporate Presentation - May 2025
Adnet Communications
 
Lundin Gold Q1 2025 Conference Call Presentation
Lundin Gold Q1 2025 Conference Call PresentationLundin Gold Q1 2025 Conference Call Presentation
Lundin Gold Q1 2025 Conference Call Presentation
Adnet Communications
 
How i get hook up with a wealthy sugar mummy is Malaysia in Kuala Lumpur
How i get hook up with a wealthy sugar mummy is Malaysia in Kuala LumpurHow i get hook up with a wealthy sugar mummy is Malaysia in Kuala Lumpur
How i get hook up with a wealthy sugar mummy is Malaysia in Kuala Lumpur
aziziaziziooo430
 
GCF - Master Presentation - UK GCF - 0525.pdf
GCF - Master Presentation - UK GCF - 0525.pdfGCF - Master Presentation - UK GCF - 0525.pdf
GCF - Master Presentation - UK GCF - 0525.pdf
hkmd5mqzjb
 
Format Meeting Bulanan Minimalist Aesthetic
Format Meeting Bulanan Minimalist AestheticFormat Meeting Bulanan Minimalist Aesthetic
Format Meeting Bulanan Minimalist Aesthetic
frenkywhijaya
 
FESE Capital Markets Fact Sheet 2025 Q1.pdf
FESE Capital Markets Fact Sheet 2025 Q1.pdfFESE Capital Markets Fact Sheet 2025 Q1.pdf
FESE Capital Markets Fact Sheet 2025 Q1.pdf
secretariat4
 
GCF - Master Presentation Buyside - UK - 0525 - GCF.pdf
GCF - Master Presentation Buyside - UK - 0525 - GCF.pdfGCF - Master Presentation Buyside - UK - 0525 - GCF.pdf
GCF - Master Presentation Buyside - UK - 0525 - GCF.pdf
hkmd5mqzjb
 
VSLA Methodology Training 2024 - Copy.ppt
VSLA Methodology Training 2024 - Copy.pptVSLA Methodology Training 2024 - Copy.ppt
VSLA Methodology Training 2024 - Copy.ppt
wodajodagim
 
An indepth study of behavioral finances.
An indepth study of behavioral finances.An indepth study of behavioral finances.
An indepth study of behavioral finances.
Khushboo Dange
 
2025-05-08 - Torex Gold - Corporate Presentation - May 2025.pdf
2025-05-08 - Torex Gold - Corporate Presentation - May 2025.pdf2025-05-08 - Torex Gold - Corporate Presentation - May 2025.pdf
2025-05-08 - Torex Gold - Corporate Presentation - May 2025.pdf
Adnet Communications
 
GCF - Our added Value in Transport & Logistics sector
GCF - Our added Value in Transport & Logistics sectorGCF - Our added Value in Transport & Logistics sector
GCF - Our added Value in Transport & Logistics sector
dpioux
 
Our added value in Software & financial services sector 0525.pdf
Our added value in Software & financial services sector 0525.pdfOur added value in Software & financial services sector 0525.pdf
Our added value in Software & financial services sector 0525.pdf
dianepioux1
 
Trumps-Tariffs-and-UK-Pensions-7.5.25.pdf
Trumps-Tariffs-and-UK-Pensions-7.5.25.pdfTrumps-Tariffs-and-UK-Pensions-7.5.25.pdf
Trumps-Tariffs-and-UK-Pensions-7.5.25.pdf
Henry Tapper
 
GCF- our added value in the industry sector 052025.pdf
GCF- our added value in the industry sector 052025.pdfGCF- our added value in the industry sector 052025.pdf
GCF- our added value in the industry sector 052025.pdf
dianepioux1
 
Ethereum's Market Value Soars Through JQRBT-Level Growth, Overtaking Major Co...
Ethereum's Market Value Soars Through JQRBT-Level Growth, Overtaking Major Co...Ethereum's Market Value Soars Through JQRBT-Level Growth, Overtaking Major Co...
Ethereum's Market Value Soars Through JQRBT-Level Growth, Overtaking Major Co...
jqrbt
 
Telegraph - 'Rachel Reeves paves way for Dutch-style pensions' May 2025.docx
Telegraph - 'Rachel Reeves paves way for Dutch-style pensions' May 2025.docxTelegraph - 'Rachel Reeves paves way for Dutch-style pensions' May 2025.docx
Telegraph - 'Rachel Reeves paves way for Dutch-style pensions' May 2025.docx
Henry Tapper
 
WRN_Investor_Presentation_May 2025 Update.pdf
WRN_Investor_Presentation_May 2025 Update.pdfWRN_Investor_Presentation_May 2025 Update.pdf
WRN_Investor_Presentation_May 2025 Update.pdf
cmagee4
 
Mastering Crypto Security: How GXCYPX Solutions Help Prevent Social Engineeri...
Mastering Crypto Security: How GXCYPX Solutions Help Prevent Social Engineeri...Mastering Crypto Security: How GXCYPX Solutions Help Prevent Social Engineeri...
Mastering Crypto Security: How GXCYPX Solutions Help Prevent Social Engineeri...
gxcypx
 
Telegraph - 'Rachel Reeves paves way for Dutch-style pensions' May 2025 2.docx
Telegraph - 'Rachel Reeves paves way for Dutch-style pensions' May 2025 2.docxTelegraph - 'Rachel Reeves paves way for Dutch-style pensions' May 2025 2.docx
Telegraph - 'Rachel Reeves paves way for Dutch-style pensions' May 2025 2.docx
Henry Tapper
 
Lundin Gold Corporate Presentation - May 2025
Lundin Gold Corporate Presentation -  May 2025Lundin Gold Corporate Presentation -  May 2025
Lundin Gold Corporate Presentation - May 2025
Adnet Communications
 
Lundin Gold Q1 2025 Conference Call Presentation
Lundin Gold Q1 2025 Conference Call PresentationLundin Gold Q1 2025 Conference Call Presentation
Lundin Gold Q1 2025 Conference Call Presentation
Adnet Communications
 
How i get hook up with a wealthy sugar mummy is Malaysia in Kuala Lumpur
How i get hook up with a wealthy sugar mummy is Malaysia in Kuala LumpurHow i get hook up with a wealthy sugar mummy is Malaysia in Kuala Lumpur
How i get hook up with a wealthy sugar mummy is Malaysia in Kuala Lumpur
aziziaziziooo430
 
GCF - Master Presentation - UK GCF - 0525.pdf
GCF - Master Presentation - UK GCF - 0525.pdfGCF - Master Presentation - UK GCF - 0525.pdf
GCF - Master Presentation - UK GCF - 0525.pdf
hkmd5mqzjb
 
Format Meeting Bulanan Minimalist Aesthetic
Format Meeting Bulanan Minimalist AestheticFormat Meeting Bulanan Minimalist Aesthetic
Format Meeting Bulanan Minimalist Aesthetic
frenkywhijaya
 
FESE Capital Markets Fact Sheet 2025 Q1.pdf
FESE Capital Markets Fact Sheet 2025 Q1.pdfFESE Capital Markets Fact Sheet 2025 Q1.pdf
FESE Capital Markets Fact Sheet 2025 Q1.pdf
secretariat4
 

Deterministic simulation testing

  • 1. Deterministic Simulation Testing of Distributed Systems For Great Justice will.wilson@foundationdb.com @FoundationDB
  • 2. 2 Debugging distributed systems is terrible
  • 3. 3 First of all, distributed systems tend to be complicated… … but it’s worse than that
  • 6. 4 Repeatability? Yeah, right A A retry
  • 7. 4 Repeatability? Yeah, right A A retry A
  • 8. 5 Lack of repeatability is a special case of non-determinism
  • 9. 5 Lack of repeatability is a special case of non-determinism A
  • 10. 5 Lack of repeatability is a special case of non-determinism A B
  • 11. 5 Lack of repeatability is a special case of non-determinism A A B
  • 12. 6 FoundationDB is a distributed stateful system with ridiculously strong guarantees ACID!
  • 13. 7 Don’t debug your system, debug a simulation instead.
  • 14. 8 3 INGREDIENTS of deterministic simulation Single-threaded pseudo-concurrency Simulated implementation of all external communication Determinism 1 2 3
  • 15. Single-threaded 1 pseudo-concurrency 9 Flow ! A syntactic extension to C++ , new keywords and actors, “compiled” down to regular C++ w/ callbacks
  • 16. 10 ACTOR Future<float> asyncAdd(Future<float> f, ! ! ! ! ! ! ! ! ! ! ! ! float offset) {! float value = wait( f );! return value + offset;! } Single-threaded 1 pseudo-concurrency
  • 17. Single-threaded 1 pseudo-concurrency 11 class AsyncAddActor : public Actor, public FastAllocated<AsyncAddActor> { public: AsyncAddActor(Future<float> const& f,float const& offset) : Actor("AsyncAddActor"), f(f), offset(offset), ChooseGroupbody1W1_1(this, &ChooseGroupbody1W1) { } Future<float> a_start() { actorReturnValue.setActorToCancel(this); auto f = actorReturnValue.getFuture(); a_body1(); return f; } private: // Implementation … }; ! Future<float> asyncAdd( Future<float> const& f, float const& offset ) { return (new AsyncAddActor(f, offset))->a_start(); }
  • 18. Single-threaded 1 pseudo-concurrency 12 int a_body1(int loopDepth=0) { try { ChooseGroupbody1W1_1.setFuture(f); loopDepth = a_body1alt1(loopDepth); } catch (Error& error) { loopDepth = a_body1Catch1(error, loopDepth); } catch (...) { loopDepth = a_body1Catch1(unknown_error(), loopDepth); } return loopDepth; } int a_body1cont1(float const& value,int loopDepth) { actorReturn(actorReturnValue, value + offset); return 0; } int a_body1when1(float const& value,int loopDepth) { loopDepth = a_body1cont1(value, loopDepth); return loopDepth; }
  • 19. Single-threaded 1 pseudo-concurrency 13 template <class T, class V> void actorReturn(Promise<T>& actorReturnValue, V const& value) { T rval = value; // explicit copy, needed in the case the return is a state variable of the actor Promise<T> rv = std::move( actorReturnValue ); ! // Break the ownership cycle this,this->actorReturnValue,this->actorReturnValue.sav,this- >actorReturnValue.sav->actorToCancel rv.clearActorToCancel(); try { delete this; } catch (...) { TraceEvent(SevError, "ActorDestructorError"); } rv.send( rval ); }
  • 20. Single-threaded 1 pseudo-concurrency 14 Programming language Ruby (using threads) Ruby (using queues) Objective C (using threads) Java (using threads) Stackless Python Erlang Go Flow Time in seconds 1990 sec 360 sec 26 sec 12 sec 1.68 sec 1.09 sec 0.87 sec 0.075 sec
  • 21. 15 Simulated 2 Implementation INetwork IConnection IAsyncFile … SimNetwork SimConnection SimFile …
  • 22. 16 void connect( Reference<Sim2Conn> peer, NetworkAddress peerEndpoint ) { this->peer = peer; this->peerProcess = peer->process; this->peerId = peer->dbgid; this->peerEndpoint = peerEndpoint; ! // Every one-way connection gets a random permanent latency and a random send buffer for the duration of the connection auto latency = g_clogging.setPairLatencyIfNotSet( peerProcess->address.ip, process- >address.ip, FLOW_KNOBS->MAX_CLOGGING_LATENCY*g_random->random01() ); sendBufSize = std::max<double>( g_random->randomInt(0, 5000000), 25e6 * (latency + .002) ); TraceEvent("Sim2Connection").detail("SendBufSize", sendBufSize).detail("Latency", latency); } Simulated 2 Implementation
  • 23. 17 Simulated 2 Implementation ACTOR static Future<Void> receiver( Sim2Conn* self ) { loop { if (self->sentBytes.get() != self->receivedBytes.get()) Void _ = wait( g_simulator.onProcess( self->peerProcess ) ); while ( self->sentBytes.get() == self->receivedBytes.get() ) Void _ = wait( self->sentBytes.onChange() ); ASSERT( g_simulator.getCurrentProcess() == self->peerProcess ); state int64_t pos = g_random->random01() < .5 ? self->sentBytes.get() : g_random- >randomInt64( self->receivedBytes.get(), self->sentBytes.get()+1 ); Void _ = wait( delay( g_clogging.getSendDelay( self->process->address, self->peerProcess- >address ) ) ); Void _ = wait( g_simulator.onProcess( self->process ) ); ASSERT( g_simulator.getCurrentProcess() == self->process ); Void _ = wait( delay( g_clogging.getRecvDelay( self->process->address, self->peerProcess- >address ) ) ); ASSERT( g_simulator.getCurrentProcess() == self->process ); self->receivedBytes.set( pos ); Void _ = wait( Void() ); // Prior notification can delete self and cancel this actor ASSERT( g_simulator.getCurrentProcess() == self->process ); } }
  • 24. 18 Simulated Implementation // Reads as many bytes as possible from the read buffer into [begin,end) and returns the number of bytes read (might be 0) // (or may throw an error if the connection dies) virtual int read( uint8_t* begin, uint8_t* end ) { rollRandomClose(); ! int64_t avail = receivedBytes.get() - readBytes.get(); // SOMEDAY: random? int toRead = std::min<int64_t>( end-begin, avail ); ASSERT( toRead >= 0 && toRead <= recvBuf.size() && toRead <= end-begin ); for(int i=0; i<toRead; i++) begin[i] = recvBuf[i]; recvBuf.erase( recvBuf.begin(), recvBuf.begin() + toRead ); readBytes.set( readBytes.get() + toRead ); return toRead; } 2
  • 25. 19 Simulated Implementation void rollRandomClose() { if (g_simulator.enableConnectionFailures && g_random->random01() < .00001) { double a = g_random->random01(), b = g_random->random01(); TEST(true); // Simulated connection failure TraceEvent("ConnectionFailure", dbgid).detail("MyAddr", process- >address).detail("PeerAddr", peerProcess->address).detail("SendClosed", a > .33).detail("RecvClosed", a < .66).detail("Explicit", b < .3); if (a < .66 && peer) peer->closeInternal(); if (a > .33) closeInternal(); // At the moment, we occasionally notice the connection failed immediately. In principle, this could happen but only after a delay. if (b < .3) throw connection_failed(); } } 2
  • 26. 20 3 Determinism We have (1) and (2), so all we need to add is none of the control flow of anything in your program depending on anything outside of your program + its inputs.
  • 27. 21 3 Determinism Use unseeds to figure out whether what happened was deterministic
  • 28. 22 1 + 2 + 3 The Simulator
  • 29. 23 Test files testTitle=SwizzledCycleTest testName=Cycle transactionsPerSecond=1000.0 testDuration=30.0 expectedRate=0.01 ! testName=RandomClogging testDuration=30.0 swizzle = 1 ! testName=Attrition machinesToKill=10 machinesToLeave=3 reboot=true testDuration=30.0 ! testName=ChangeConfig maxDelayBeforeChange=30.0 coordinators=auto
  • 30. 24 Other Simulated disasters In parallel with the workloads, we run some other things like: ! • broken machine • clogging • swizzling • nukes • dumb sysadmin • etc.
  • 31. 25 You are looking for bugs… the universe is also looking for bugs How can you make your CPUs more efficient than the universe’s?
  • 32. 26 1. Disasters here happen more frequently than in the real world
  • 33. 27 2. Buggify! if (BUGGIFY) toSend = std::min(toSend, g_random->randomInt(0, 1000)); ! when( Void _ = wait( BUGGIFY ? Never() : delay( g_network->isSimulated() ? 20 : 900 ) ) ) { req.reply.sendError( timed_out() ); }
  • 34. 28 3. The Hurst exponent
  • 35. 29 3. The Hurst exponent
  • 36. 30 3. The Hurst exponent
  • 37. 31 We estimate we’ve run the equivalent of trillions of hours of “real world” tests
  • 38. 32 BAD NEWS: ! We broke debugging (but at least it’s possible)
  • 40. 34 Two “bugs” found by Sinkhole 1. Power safety bug in ZK 2. Linux package managers writing conf files don’t sync
  • 41. 35 Future directions 1. Dedicated “red team” 2. More hardware 3. Try to catch bugs that “evolve” 4. More real world testing
  • 43. Data Partitioning Keyspace is partitioned onto different machines for scalability
  • 44. Data Replication The same keys are copied onto different machines for fault tolerance
  • 45. FoundationDB Partitioning + replication for both scalability and fault tolerance
  • 47. Transaction Processing • Decompose the transaction processing pipeline into stages • Each stage is distributed
  • 48. Pipeline Stages • Accept client transactions • Apply conflict checking • Write to transaction logs • Update persistent data structures High Performance!
  • 49. Performance Results • 24 machine cluster • 100% cross-node transactions • Saturates its SSDs 890,000 ops/sec
  翻译: