SlideShare ist ein Scribd-Unternehmen logo
1 von 50
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

ClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
ClickHouse Mark Cache, by Mik Kocikowski, CloudflareClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
ClickHouse Mark Cache, by Mik Kocikowski, CloudflareAltinity Ltd
 
How to reduce expenses on monitoring
How to reduce expenses on monitoringHow to reduce expenses on monitoring
How to reduce expenses on monitoringRomanKhavronenko
 
10 Good Reasons to Use ClickHouse
10 Good Reasons to Use ClickHouse10 Good Reasons to Use ClickHouse
10 Good Reasons to Use ClickHouserpolat
 
Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Mario Fusco
 
Time to-live: How to Perform Automatic State Cleanup in Apache Flink - Andrey...
Time to-live: How to Perform Automatic State Cleanup in Apache Flink - Andrey...Time to-live: How to Perform Automatic State Cleanup in Apache Flink - Andrey...
Time to-live: How to Perform Automatic State Cleanup in Apache Flink - Andrey...Flink Forward
 
Monitoring MySQL Replication lag with Prometheus & pt-heartbeat
Monitoring MySQL Replication lag with Prometheus & pt-heartbeatMonitoring MySQL Replication lag with Prometheus & pt-heartbeat
Monitoring MySQL Replication lag with Prometheus & pt-heartbeatJulien Pivotto
 
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...Altinity Ltd
 
Coredns nodecache - A highly-available Node-cache DNS server
Coredns nodecache - A highly-available Node-cache DNS serverCoredns nodecache - A highly-available Node-cache DNS server
Coredns nodecache - A highly-available Node-cache DNS serverYann Hamon
 
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
Migration to ClickHouse. Practical guide, by Alexander ZaitsevMigration to ClickHouse. Practical guide, by Alexander Zaitsev
Migration to ClickHouse. Practical guide, by Alexander ZaitsevAltinity Ltd
 
JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013Vladimir Ivanov
 
mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교Woo Yeong Choi
 
Deep Dive on ClickHouse Sharding and Replication-2202-09-22.pdf
Deep Dive on ClickHouse Sharding and Replication-2202-09-22.pdfDeep Dive on ClickHouse Sharding and Replication-2202-09-22.pdf
Deep Dive on ClickHouse Sharding and Replication-2202-09-22.pdfAltinity Ltd
 
Advanced Node.JS Meetup
Advanced Node.JS MeetupAdvanced Node.JS Meetup
Advanced Node.JS MeetupLINAGORA
 
Kernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uringKernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uringAnne Nicolas
 
JavaOne 2012 - JVM JIT for Dummies
JavaOne 2012 - JVM JIT for DummiesJavaOne 2012 - JVM JIT for Dummies
JavaOne 2012 - JVM JIT for DummiesCharles Nutter
 
ClickHouse Monitoring 101: What to monitor and how
ClickHouse Monitoring 101: What to monitor and howClickHouse Monitoring 101: What to monitor and how
ClickHouse Monitoring 101: What to monitor and howAltinity Ltd
 
How a BEAM runner executes a pipeline. Apache BEAM Summit London 2018
How a BEAM runner executes a pipeline. Apache BEAM Summit London 2018How a BEAM runner executes a pipeline. Apache BEAM Summit London 2018
How a BEAM runner executes a pipeline. Apache BEAM Summit London 2018javier ramirez
 
Size Matters-Best Practices for Trillion Row Datasets on ClickHouse-2202-08-1...
Size Matters-Best Practices for Trillion Row Datasets on ClickHouse-2202-08-1...Size Matters-Best Practices for Trillion Row Datasets on ClickHouse-2202-08-1...
Size Matters-Best Practices for Trillion Row Datasets on ClickHouse-2202-08-1...Altinity Ltd
 

Was ist angesagt? (20)

ClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
ClickHouse Mark Cache, by Mik Kocikowski, CloudflareClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
ClickHouse Mark Cache, by Mik Kocikowski, Cloudflare
 
How to reduce expenses on monitoring
How to reduce expenses on monitoringHow to reduce expenses on monitoring
How to reduce expenses on monitoring
 
10 Good Reasons to Use ClickHouse
10 Good Reasons to Use ClickHouse10 Good Reasons to Use ClickHouse
10 Good Reasons to Use ClickHouse
 
Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...
 
Time to-live: How to Perform Automatic State Cleanup in Apache Flink - Andrey...
Time to-live: How to Perform Automatic State Cleanup in Apache Flink - Andrey...Time to-live: How to Perform Automatic State Cleanup in Apache Flink - Andrey...
Time to-live: How to Perform Automatic State Cleanup in Apache Flink - Andrey...
 
Monitoring MySQL Replication lag with Prometheus & pt-heartbeat
Monitoring MySQL Replication lag with Prometheus & pt-heartbeatMonitoring MySQL Replication lag with Prometheus & pt-heartbeat
Monitoring MySQL Replication lag with Prometheus & pt-heartbeat
 
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
Webinar slides: MORE secrets of ClickHouse Query Performance. By Robert Hodge...
 
Coredns nodecache - A highly-available Node-cache DNS server
Coredns nodecache - A highly-available Node-cache DNS serverCoredns nodecache - A highly-available Node-cache DNS server
Coredns nodecache - A highly-available Node-cache DNS server
 
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
Migration to ClickHouse. Practical guide, by Alexander ZaitsevMigration to ClickHouse. Practical guide, by Alexander Zaitsev
Migration to ClickHouse. Practical guide, by Alexander Zaitsev
 
Second Level Cache in JPA Explained
Second Level Cache in JPA ExplainedSecond Level Cache in JPA Explained
Second Level Cache in JPA Explained
 
JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013
 
mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교
 
Deep Dive on ClickHouse Sharding and Replication-2202-09-22.pdf
Deep Dive on ClickHouse Sharding and Replication-2202-09-22.pdfDeep Dive on ClickHouse Sharding and Replication-2202-09-22.pdf
Deep Dive on ClickHouse Sharding and Replication-2202-09-22.pdf
 
Advanced Node.JS Meetup
Advanced Node.JS MeetupAdvanced Node.JS Meetup
Advanced Node.JS Meetup
 
Kernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uringKernel Recipes 2019 - Faster IO through io_uring
Kernel Recipes 2019 - Faster IO through io_uring
 
Cours JavaScript
Cours JavaScriptCours JavaScript
Cours JavaScript
 
JavaOne 2012 - JVM JIT for Dummies
JavaOne 2012 - JVM JIT for DummiesJavaOne 2012 - JVM JIT for Dummies
JavaOne 2012 - JVM JIT for Dummies
 
ClickHouse Monitoring 101: What to monitor and how
ClickHouse Monitoring 101: What to monitor and howClickHouse Monitoring 101: What to monitor and how
ClickHouse Monitoring 101: What to monitor and how
 
How a BEAM runner executes a pipeline. Apache BEAM Summit London 2018
How a BEAM runner executes a pipeline. Apache BEAM Summit London 2018How a BEAM runner executes a pipeline. Apache BEAM Summit London 2018
How a BEAM runner executes a pipeline. Apache BEAM Summit London 2018
 
Size Matters-Best Practices for Trillion Row Datasets on ClickHouse-2202-08-1...
Size Matters-Best Practices for Trillion Row Datasets on ClickHouse-2202-08-1...Size Matters-Best Practices for Trillion Row Datasets on ClickHouse-2202-08-1...
Size Matters-Best Practices for Trillion Row Datasets on ClickHouse-2202-08-1...
 

Andere mochten auch

Load balancing theory and practice
Load balancing theory and practiceLoad balancing theory and practice
Load balancing theory and practiceFoundationDB
 
Building FoundationDB
Building FoundationDBBuilding FoundationDB
Building FoundationDBFoundationDB
 
Estacion los angeles
Estacion los angelesEstacion los angeles
Estacion los angelesJAIME JIPSION
 
My Trip Through Australia
My Trip Through AustraliaMy Trip Through Australia
My Trip Through Australiadeankathryn
 
рождественский вертеп
рождественский вертепрождественский вертеп
рождественский вертеп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 DichotomyDan Sullivan, Ph.D.
 

Andere mochten auch (13)

Load balancing theory and practice
Load balancing theory and practiceLoad balancing theory and practice
Load balancing theory and practice
 
NoSQL and ACID
NoSQL and ACIDNoSQL and ACID
NoSQL and ACID
 
Building FoundationDB
Building FoundationDBBuilding FoundationDB
Building FoundationDB
 
FoundationDB - NoSQL and ACID
FoundationDB - NoSQL and ACIDFoundationDB - NoSQL and ACID
FoundationDB - NoSQL and ACID
 
Estacion los angeles
Estacion los angelesEstacion los angeles
Estacion los angeles
 
Лицей
ЛицейЛицей
Лицей
 
Simple past lesson
Simple past lesson Simple past lesson
Simple past lesson
 
My Trip Through Australia
My Trip Through AustraliaMy Trip Through Australia
My Trip Through Australia
 
Музей Истоки
Музей ИстокиМузей Истоки
Музей Истоки
 
рождественский вертеп
рождественский вертепрождественский вертеп
рождественский вертеп
 
Nosql databases
Nosql databasesNosql databases
Nosql databases
 
Distributed computing
Distributed computingDistributed computing
Distributed computing
 
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
 

Ähnlich wie Deterministic simulation testing

Node.js System: The Landing
Node.js System: The LandingNode.js System: The Landing
Node.js System: The LandingHaci Murat Yaman
 
To Err Is Human
To Err Is HumanTo Err Is Human
To Err Is HumanAlex 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 JVMDierk 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 184Mahmoud 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 interpreterakaptur
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsAzul 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.pdfaoecmtin
 
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 practicesAnkit 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 - BuildPiperLuciano 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 OpenAzul 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 RyuJITEgor Bogatov
 
"Quantum" performance effects
"Quantum" performance effects"Quantum" performance effects
"Quantum" performance effectsSergey 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 & OCMockRobot 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
 

Ähnlich wie Deterministic simulation testing (20)

Node.js System: The Landing
Node.js System: The LandingNode.js System: The Landing
Node.js System: The Landing
 
To Err Is Human
To Err Is HumanTo Err Is Human
To Err Is Human
 
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
 
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
 
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?
 
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
 
Silicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM MechanicsSilicon Valley JUG: JVM Mechanics
Silicon Valley JUG: JVM Mechanics
 
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
 
Windbg랑 친해지기
Windbg랑 친해지기Windbg랑 친해지기
Windbg랑 친해지기
 
ssh.isdn.test
ssh.isdn.testssh.isdn.test
ssh.isdn.test
 
掀起 Swift 的面紗
掀起 Swift 的面紗掀起 Swift 的面紗
掀起 Swift 的面紗
 
Ten useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesTen useful JavaScript tips & best practices
Ten useful JavaScript tips & best practices
 
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
 
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
 
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
 
"Quantum" performance effects
"Quantum" performance effects"Quantum" performance effects
"Quantum" performance effects
 
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
 
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)
 

Kürzlich hochgeladen

Stock Market Brief Deck FOR 4/17 video.pdf
Stock Market Brief Deck FOR 4/17 video.pdfStock Market Brief Deck FOR 4/17 video.pdf
Stock Market Brief Deck FOR 4/17 video.pdfMichael Silva
 
Governor Olli Rehn: Dialling back monetary restraint
Governor Olli Rehn: Dialling back monetary restraintGovernor Olli Rehn: Dialling back monetary restraint
Governor Olli Rehn: Dialling back monetary restraintSuomen Pankki
 
原版1:1复刻温哥华岛大学毕业证Vancouver毕业证留信学历认证
原版1:1复刻温哥华岛大学毕业证Vancouver毕业证留信学历认证原版1:1复刻温哥华岛大学毕业证Vancouver毕业证留信学历认证
原版1:1复刻温哥华岛大学毕业证Vancouver毕业证留信学历认证rjrjkk
 
Uae-NO1 Kala Jadu specialist Expert in Pakistan kala ilam specialist Expert i...
Uae-NO1 Kala Jadu specialist Expert in Pakistan kala ilam specialist Expert i...Uae-NO1 Kala Jadu specialist Expert in Pakistan kala ilam specialist Expert i...
Uae-NO1 Kala Jadu specialist Expert in Pakistan kala ilam specialist Expert i...Amil baba
 
The Triple Threat | Article on Global Resession | Harsh Kumar
The Triple Threat | Article on Global Resession | Harsh KumarThe Triple Threat | Article on Global Resession | Harsh Kumar
The Triple Threat | Article on Global Resession | Harsh KumarHarsh Kumar
 
Unveiling Business Expansion Trends in 2024
Unveiling Business Expansion Trends in 2024Unveiling Business Expansion Trends in 2024
Unveiling Business Expansion Trends in 2024Champak Jhagmag
 
Overview of Inkel Unlisted Shares Price.
Overview of Inkel Unlisted Shares Price.Overview of Inkel Unlisted Shares Price.
Overview of Inkel Unlisted Shares Price.Precize Formely Leadoff
 
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...Amil baba
 
PMFBY , Pradhan Mantri Fasal bima yojna
PMFBY , Pradhan Mantri  Fasal bima yojnaPMFBY , Pradhan Mantri  Fasal bima yojna
PMFBY , Pradhan Mantri Fasal bima yojnaDharmendra Kumar
 
SBP-Market-Operations and market managment
SBP-Market-Operations and market managmentSBP-Market-Operations and market managment
SBP-Market-Operations and market managmentfactical
 
NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...
NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...
NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...Amil baba
 
NO1 Certified kala jadu karne wale ka contact number kala jadu karne wale bab...
NO1 Certified kala jadu karne wale ka contact number kala jadu karne wale bab...NO1 Certified kala jadu karne wale ka contact number kala jadu karne wale bab...
NO1 Certified kala jadu karne wale ka contact number kala jadu karne wale bab...Amil baba
 
Tenets of Physiocracy History of Economic
Tenets of Physiocracy History of EconomicTenets of Physiocracy History of Economic
Tenets of Physiocracy History of Economiccinemoviesu
 
Call Girls Near Golden Tulip Essential Hotel, New Delhi 9873777170
Call Girls Near Golden Tulip Essential Hotel, New Delhi 9873777170Call Girls Near Golden Tulip Essential Hotel, New Delhi 9873777170
Call Girls Near Golden Tulip Essential Hotel, New Delhi 9873777170Sonam Pathan
 
Stock Market Brief Deck for "this does not happen often".pdf
Stock Market Brief Deck for "this does not happen often".pdfStock Market Brief Deck for "this does not happen often".pdf
Stock Market Brief Deck for "this does not happen often".pdfMichael Silva
 
Role of Information and technology in banking and finance .pptx
Role of Information and technology in banking and finance .pptxRole of Information and technology in banking and finance .pptx
Role of Information and technology in banking and finance .pptxNarayaniTripathi2
 
Economics, Commerce and Trade Management: An International Journal (ECTIJ)
Economics, Commerce and Trade Management: An International Journal (ECTIJ)Economics, Commerce and Trade Management: An International Journal (ECTIJ)
Economics, Commerce and Trade Management: An International Journal (ECTIJ)ECTIJ
 
NCDC and NAFED presentation by Paras .pptx
NCDC and NAFED presentation by Paras .pptxNCDC and NAFED presentation by Paras .pptx
NCDC and NAFED presentation by Paras .pptxnaikparas90
 
cost of capital questions financial management
cost of capital questions financial managementcost of capital questions financial management
cost of capital questions financial managementtanmayarora23
 
2024 Q1 Crypto Industry Report | CoinGecko
2024 Q1 Crypto Industry Report | CoinGecko2024 Q1 Crypto Industry Report | CoinGecko
2024 Q1 Crypto Industry Report | CoinGeckoCoinGecko
 

Kürzlich hochgeladen (20)

Stock Market Brief Deck FOR 4/17 video.pdf
Stock Market Brief Deck FOR 4/17 video.pdfStock Market Brief Deck FOR 4/17 video.pdf
Stock Market Brief Deck FOR 4/17 video.pdf
 
Governor Olli Rehn: Dialling back monetary restraint
Governor Olli Rehn: Dialling back monetary restraintGovernor Olli Rehn: Dialling back monetary restraint
Governor Olli Rehn: Dialling back monetary restraint
 
原版1:1复刻温哥华岛大学毕业证Vancouver毕业证留信学历认证
原版1:1复刻温哥华岛大学毕业证Vancouver毕业证留信学历认证原版1:1复刻温哥华岛大学毕业证Vancouver毕业证留信学历认证
原版1:1复刻温哥华岛大学毕业证Vancouver毕业证留信学历认证
 
Uae-NO1 Kala Jadu specialist Expert in Pakistan kala ilam specialist Expert i...
Uae-NO1 Kala Jadu specialist Expert in Pakistan kala ilam specialist Expert i...Uae-NO1 Kala Jadu specialist Expert in Pakistan kala ilam specialist Expert i...
Uae-NO1 Kala Jadu specialist Expert in Pakistan kala ilam specialist Expert i...
 
The Triple Threat | Article on Global Resession | Harsh Kumar
The Triple Threat | Article on Global Resession | Harsh KumarThe Triple Threat | Article on Global Resession | Harsh Kumar
The Triple Threat | Article on Global Resession | Harsh Kumar
 
Unveiling Business Expansion Trends in 2024
Unveiling Business Expansion Trends in 2024Unveiling Business Expansion Trends in 2024
Unveiling Business Expansion Trends in 2024
 
Overview of Inkel Unlisted Shares Price.
Overview of Inkel Unlisted Shares Price.Overview of Inkel Unlisted Shares Price.
Overview of Inkel Unlisted Shares Price.
 
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
NO1 WorldWide Love marriage specialist baba ji Amil Baba Kala ilam powerful v...
 
PMFBY , Pradhan Mantri Fasal bima yojna
PMFBY , Pradhan Mantri  Fasal bima yojnaPMFBY , Pradhan Mantri  Fasal bima yojna
PMFBY , Pradhan Mantri Fasal bima yojna
 
SBP-Market-Operations and market managment
SBP-Market-Operations and market managmentSBP-Market-Operations and market managment
SBP-Market-Operations and market managment
 
NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...
NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...
NO1 Certified Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Ami...
 
NO1 Certified kala jadu karne wale ka contact number kala jadu karne wale bab...
NO1 Certified kala jadu karne wale ka contact number kala jadu karne wale bab...NO1 Certified kala jadu karne wale ka contact number kala jadu karne wale bab...
NO1 Certified kala jadu karne wale ka contact number kala jadu karne wale bab...
 
Tenets of Physiocracy History of Economic
Tenets of Physiocracy History of EconomicTenets of Physiocracy History of Economic
Tenets of Physiocracy History of Economic
 
Call Girls Near Golden Tulip Essential Hotel, New Delhi 9873777170
Call Girls Near Golden Tulip Essential Hotel, New Delhi 9873777170Call Girls Near Golden Tulip Essential Hotel, New Delhi 9873777170
Call Girls Near Golden Tulip Essential Hotel, New Delhi 9873777170
 
Stock Market Brief Deck for "this does not happen often".pdf
Stock Market Brief Deck for "this does not happen often".pdfStock Market Brief Deck for "this does not happen often".pdf
Stock Market Brief Deck for "this does not happen often".pdf
 
Role of Information and technology in banking and finance .pptx
Role of Information and technology in banking and finance .pptxRole of Information and technology in banking and finance .pptx
Role of Information and technology in banking and finance .pptx
 
Economics, Commerce and Trade Management: An International Journal (ECTIJ)
Economics, Commerce and Trade Management: An International Journal (ECTIJ)Economics, Commerce and Trade Management: An International Journal (ECTIJ)
Economics, Commerce and Trade Management: An International Journal (ECTIJ)
 
NCDC and NAFED presentation by Paras .pptx
NCDC and NAFED presentation by Paras .pptxNCDC and NAFED presentation by Paras .pptx
NCDC and NAFED presentation by Paras .pptx
 
cost of capital questions financial management
cost of capital questions financial managementcost of capital questions financial management
cost of capital questions financial management
 
2024 Q1 Crypto Industry Report | CoinGecko
2024 Q1 Crypto Industry Report | CoinGecko2024 Q1 Crypto Industry Report | CoinGecko
2024 Q1 Crypto Industry Report | CoinGecko
 

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