SlideShare a Scribd company logo
[ ИМИДЖЕВОЕ
ИЗОБРАЖЕНИЕ ]
Live Testing of
Distributed System
Fault Tolerance With
Fault Injection
Techniques
Alexey Vasyukov,
Inventa
Vadim Zherder,
Moscow Exchange
Plan
• Introduction
Distributed Trading System concepts
• Distributed Consensus protocol
• MOEX Fault Injection testing framework
2
Trading System concepts
3
Trading System
4
Transactions Processing
• One incoming stream
• Strictly ordered FIFO incoming stream
• SeqNum
• TimeStamp
• Strictly ordered FIFO outcoming stream
• Each transaction should get reply
• No loss, no duplicates
• Multistage processing
• No 1 – finished, No 2,3 – in process, No 4 - incoming
• Transaction processing result
• ErrorCode, Message, Statuses, …
• TransLog = Transactions Log
• Transaction buffer
• Large but finite. When exhausted, TS stops processing transactions and become
“unavailable”
5
Trading System: what’s behind
6
Messaging
7
UP – transactions
DOWN – responses and messages to
nodes of the cluster
Use CRC (Cyclic redundancy check)
to control transaction flow
Full history: “Late join” is possible
Role: “Main”
“Main” = the main TS instance
• Get new transactions from incoming stream
• Broadcast transactions within cluster
• Process transactions
• Check transaction result (compare to results obtained from other nodes)
• Broadcast results within cluster
• Publish replies to clients
8
Role: “Backup”
“Backup” = a special state of TS instance
• Can be switched to Main quickly
• Get all transactions from Main
• Process transactions independently
• Check transaction result (compare to results from other nodes)
• Write its own TransLog
• Do not send replies to clients
9
Role: “Backup”
2 modes: SYNC (“Hot Backup”) and ASYNC (“Warm Backup”)
10
If Main failed, SYNC can switch to Main
automatically
SYNC publish transaction results
If SYNC failed, ASYNC can switch to SYNC
automatically
ASYNC does not publish transaction result
ASYNC can be switched to Main manually
by Operator
Number of SYNCs is a static parameter determined by Operator
Role: Governor
11
Governor can
• Force node to change its role
• Force node to stop
• Start Elections to assign new Main
Only one Governor in the cluster
Governor can be assigned only by Operator
Governor role cannot be changed
If some node asks Governor but it is unavailable then this node stalls
until it recovers connectivity to the Governor
Governor can be recovered or restarted only by Operator
Roles Summary
12
Governor Main SYNC Backup ASYNC Backup
Send Table of states V V V V
Get Client Transaction V
Broadcast Transaction V
Process Transaction V V V
Broadcast Transaction
result
V V
Compare transaction
results
V V V
Send replies to clients V
Can Switch to Main SYNC
If something goes wrong…
13
IF we detect
• Mismatch in transaction result
• A node does not respond
• No new transactions incoming
• Wrong CRC
• Governor does not response
• Mismatch in tables of states
• …
THEN
ASK Governor
Elections
14
Elections Starts to assign new Main
Stop transaction processing
2-fold Generation counter (G:S)
Initial values (0:0)
Every successful election increases G and drop S to 0 (G:0).
Every round of elections increases S
Example: (1:0) -> (1:1) -> (1:2) -> (2:0)
Generation counter in every message to/from Governor
2-Phase commit approach
Governor sends new table of states and waits for confirmation
from all nodes
Distributed
consensus protocol
15
MOEX Consensus Protocol
(by Sergey Kostanbaev, MOEX)
16
We must provide Tables of state to be consistent at all nodes during
normal work period
We must provide Tables of state to become consistent after some nodes
failed
Node 1 Node 2 Node 3 Node 4
uuid1 S_MAIN S_GOVERNOR S_BACKUP_SYNC S_BACKUP_ASYNC
uuid2 S_MAIN S_GOVERNOR S_BACKUP_SYNC S_BACKUP_ASYNC
uuid3 S_MAIN S_GOVERNOR S_BACKUP_SYNC S_BACKUP_ASYNC
uuid4 S_MAIN S_GOVERNOR S_BACKUP_SYNC S_BACKUP_ASYNC
Table of States at each node
MOEX Consensus Protocol
17
Thus, it is an example of a Distributed consensus protocol
Other examples:
• Paxos, 1998, 2001, …
LAMPORT, L. Paxos made simple. ACM SIGACT News 32, 4 (Dec. 2001), 18–25.
• RAFT, 2014 https://raft.github.io/raft.pdf
ONGARO, D., AND OUSTERHOUT, J. In search of an understandable consensus
algorithm. In Proc ATC’14,USENIX Annual Technical Conference (2014), USENIX
• DNCP, 2016 https://tools.ietf.org/html/rfc7787
Open questions:
Is MOEX CP equivalent to any of known protocols?
Hypothesis on MOEX CP features
H1. Byzantine fault tolerance
H2. Safety
H3. No liveness
Cluster Normal State Requirements
18
• There is exactly 1 Governor in the cluster
• There is exactly 1 Main in the cluster
• Tables of states at all nodes are consistent
• All active nodes in the cluster have the same value of
Generation Counter
• The cluster is available (for client connection) and process
transactions
• All nodes process the same sequence of transactions
• Either number of SYNCs equals to the predefined value, or it is
less than predefined value and there is no ASYNCs
…
Main “Theorem”
19
• Assume that the cluster was in Normal state, and one of Main
or Backup node fails. Then the cluster goes back to Normal
state during finite time.
MOEX CP Testing
20
Investigate
• Fault detection
• Implementation correctness
• Timing
• Dependence on load profile
• Dependence on environment configuration
• Statistics
Integration with CI/CD processes
Typical Test Scenario
21
1. Start all
2. Wait for normal state
3. Start transactions generator
4. Keep transactions flow for some time
5. Fault injection – emulate fault (single or multiple)
6. Wait for normal state (check timeout)
7. Check state at each node
8. Get artifacts
References
22
WIDDER J., Introduction into Fault-tolerant Distributed Algorithms and their Modeling, TMPA
(2014)
LAMPORT, L. Paxos made simple. ACM SIGACT News 32, 4 (Dec. 2001), 18–25.
https://raft.github.io/raft.pdf
ONGARO, D., AND OUSTERHOUT, J. In search of an understandable consensus algorithm. In
Proc ATC’14,USENIX Annual Technical Conference (2014), USENIX
ONGARO D. Consensus: Bridging theory and practice : Doctoral dissertation – Stanford
University, 2014.
MOEX Fault Injection
Testing Framework
23
Fault Injection: Testing Implementation
24
MOEX Fault Injection Framework
Concepts
• End-to-end testing of cluster implementation
• Starts complete real system on real infrastructure
• Provides modules to inject predictable faults on selected servers
• Provides domain specific libraries to write tests
• System, network, app issues are injected directly
• Misconfiguration problems are tested indirectly
(real infrastructure, config push before test start)
25
Architecture
26
Inject Techniques
OS Processes
• Kill (SIGKILL)
• Hang (SIGSTOP for N seconds + SIGCONT)
Network
• Interface “blink” (DROP 100% packets for N seconds)
• Interface “noise” (DROP X% packets for N seconds)
• Content filtering – allows “smart” inject into protocol, dropping selected
messages from the flow
Application
• Data corrupt (with gdb script) – emulates application level issues from
incorrect calculation
27
Basic Cluster State Validations
28
# Code Description
00 ALIVE_ON_START Cluster nodes should start correctly
01 SINGLE_MAIN Only one node should consider itself MAIN
02 GW_OK All gateways should be connected to correct MAIN
03 GEN_OK All active cluster nodes should have the same generation
04 TE_VIEW_OK Current MAIN should be connected to all alive nodes
05 CLU_VIEW_CONSISTENT All alive nodes should have the same cluster view
06 ELECTIONS_OK Elections count during the test should match inject scenario
07 DEAD_NODES_OK The number of lost nodes should match inject scenario
08 CLIENTS_ALIVE Clients should not notice any issue, fault handling logic is
completely hidden from them
Test Targets
• Basic system faults
• Multiple system faults on different nodes
• Application level faults
• Random network instabilities
• Recovery after faults
• Governor stability (failures, restarts, failures during elections)
29
Test Summary
30
Logs from all nodes
for root cause analysisCluster state
validations summary
Cluster nodes states
(Sync Backup is dead,
Async Backup switched to Sync)
Basic Fault: Overall System Behavior
Event log timeline
BS died,
elections started
Elections,
no transactions
Resumed
operation
Restore After Fault: Overall System Behavior
BS hanged,
elections started
Elections,
no transactions
Resumed
operation
BS is alive again
BS rejoins the cluster,
receiving missed transactions
Performance Metrics
• Key performance data from all cluster nodes
• How faults influence service quality for consumers?
• Compare configurations (indirectly, together with config push)
33
Domain Specific Language
• Useful for ad-hoc tests and quick analysis
• Complements set of 'default' tests (written in Python)
34
Statistics
• Multiple runs to identify problems without stable reproducers
• Heatmap to analyze quickly both which tests and which validations fail
35
References
36
Similar tools:
1. Netflix Simian Army; http://techblog.netflix.com/2011/07/netflix-simian-army.html
2. Jepsen; https://jepsen.io/
Reading:
1. Caitie McCaffrey. 2015. The Verification of a Distributed System. Queue 13, 9, pages 60
(December 2015), 11 pages. DOI=http://dx.doi.org/10.1145/2857274.2889274
2. Alvaro, P., Rosen, J. and Hellerstein, J.M. 2015. Lineage-driven fault injection.
http://www.cs.berkeley.edu/~palvaro/molly.pdf
3. Yuan, D., Luo, Y., Zhuang, X., Rodrigues, G. R., Zhao, X., Zhang, Y., Jain, P. U., Stumm, M.
2014. Simple testing can prevent most critical failures: an analysis of production failures in
distributed data-intensive systems; https://www.usenix.org/conference/osdi14/technical-
sessions/presentation/yuan
4. Ghosh S. et al. 1997. Software Fault Injection Testing on a Distributed System – A Case Study
5. Lai, M.-Y., Wang S.Y. 1995. Software Fault Insertion Testing for Fault Tolerance. Software Fault
Tolerance, Edited by Lyu, Chapter 13.
Questions
37
Thank you!
38

More Related Content

What's hot (20)

PDF
Design for Testability
Stanislav Tiurikov
 
PPTX
Værktøjer udviklet på AAU til analyse af SCJ programmer
InfinIT - Innovationsnetværket for it
 
PPTX
Concurrency
rizwanaabassi
 
PDF
Operating Systems 1 (8/12) - Concurrency
Peter Tröger
 
PPTX
Process synchronization
Syed Hassan Ali
 
PDF
TMPA-2017: A Survey on Model-Based Testing Tools for Test Case Generation
Iosif Itkin
 
PDF
Process modelling at BaneDanmark
InfinIT - Innovationsnetværket for it
 
PPTX
Process synchronization
Ali Ahmad
 
PPTX
Scan insertion
kumar gavanurmath
 
PPTX
Implementation of Election Algorithm of Distributed Systems in Client-Server ...
Mushfekur Rahman
 
DOCX
Critical section operating system
Muhammad Baqar Kazmi
 
PPT
Process Synchronization And Deadlocks
tech2click
 
PDF
Database applicationtesting
Renuka Ballal
 
PPTX
Mutual Exclusion using Peterson's Algorithm
Souvik Roy
 
PPTX
Concurrency: Mutual Exclusion and Synchronization
Anas Ebrahim
 
PDF
Model-driven trace diagnostics for pattern-based temporal specifications
Lionel Briand
 
PDF
Enabling Model Testing of Cyber Physical Systems
Lionel Briand
 
PDF
How to improve your Tizen native program
Ryo Jin
 
PDF
Automated and Scalable Solutions for Software Testing: The Essential Role of ...
Lionel Briand
 
Design for Testability
Stanislav Tiurikov
 
Værktøjer udviklet på AAU til analyse af SCJ programmer
InfinIT - Innovationsnetværket for it
 
Concurrency
rizwanaabassi
 
Operating Systems 1 (8/12) - Concurrency
Peter Tröger
 
Process synchronization
Syed Hassan Ali
 
TMPA-2017: A Survey on Model-Based Testing Tools for Test Case Generation
Iosif Itkin
 
Process modelling at BaneDanmark
InfinIT - Innovationsnetværket for it
 
Process synchronization
Ali Ahmad
 
Scan insertion
kumar gavanurmath
 
Implementation of Election Algorithm of Distributed Systems in Client-Server ...
Mushfekur Rahman
 
Critical section operating system
Muhammad Baqar Kazmi
 
Process Synchronization And Deadlocks
tech2click
 
Database applicationtesting
Renuka Ballal
 
Mutual Exclusion using Peterson's Algorithm
Souvik Roy
 
Concurrency: Mutual Exclusion and Synchronization
Anas Ebrahim
 
Model-driven trace diagnostics for pattern-based temporal specifications
Lionel Briand
 
Enabling Model Testing of Cyber Physical Systems
Lionel Briand
 
How to improve your Tizen native program
Ryo Jin
 
Automated and Scalable Solutions for Software Testing: The Essential Role of ...
Lionel Briand
 

Viewers also liked (20)

PDF
TMPA-2017: Generating Cost Aware Covering Arrays For Free
Iosif Itkin
 
PDF
TMPA-2017: Defect Report Classification in Accordance with Areas of Testing
Iosif Itkin
 
PDF
TMPA-2017: Static Checking of Array Objects in JavaScript
Iosif Itkin
 
PDF
TMPA-2017: Conference Opening
Iosif Itkin
 
PDF
TMPA-2017: Compositional Process Model Synthesis based on Interface Patterns
Iosif Itkin
 
PDF
TMPA-2017: Vellvm - Verifying the LLVM
Iosif Itkin
 
PDF
TMPA-2017: Using Functional Directives to Analyze Code Complexity and Communi...
Iosif Itkin
 
PDF
TMPA-2017: Modeling of PLC-programs by High-level Coloured Petri Nets
Iosif Itkin
 
PDF
TMPA-2017: The Quest for Average Response Time
Iosif Itkin
 
PDF
TMPA-2017: Evolutionary Algorithms in Test Generation for digital systems
Iosif Itkin
 
PDF
TMPA-2017: Layered Layouts for Software Systems Visualization
Iosif Itkin
 
PDF
TMPA-2017: Functional Parser of Markdown Language Based on Monad Combining an...
Iosif Itkin
 
PDF
TMPA-2017: Predicate Abstraction Based Configurable Method for Data Race Dete...
Iosif Itkin
 
PDF
TMPA-2017: Dl-Check: Dynamic Potential Deadlock Detection Tool for Java Programs
Iosif Itkin
 
PDF
TMPA-2017: Extended Context-Free Grammars Parsing with Generalized LL
Iosif Itkin
 
PDF
TMPA-2017: Simple Type Based Alias Analysis for a VLIW Processor
Iosif Itkin
 
PDF
TMPA-2015: The Verification of Functional Programs by Applying Statechart Dia...
Iosif Itkin
 
PDF
TMPA-2015: Implementing the MetaVCG Approach in the C-light System
Iosif Itkin
 
PDF
TMPA-2015: Formal Methods in Robotics
Iosif Itkin
 
PPT
TMPA-2015: ClearTH: a Tool for Automated Testing of Post Trade Systems
Iosif Itkin
 
TMPA-2017: Generating Cost Aware Covering Arrays For Free
Iosif Itkin
 
TMPA-2017: Defect Report Classification in Accordance with Areas of Testing
Iosif Itkin
 
TMPA-2017: Static Checking of Array Objects in JavaScript
Iosif Itkin
 
TMPA-2017: Conference Opening
Iosif Itkin
 
TMPA-2017: Compositional Process Model Synthesis based on Interface Patterns
Iosif Itkin
 
TMPA-2017: Vellvm - Verifying the LLVM
Iosif Itkin
 
TMPA-2017: Using Functional Directives to Analyze Code Complexity and Communi...
Iosif Itkin
 
TMPA-2017: Modeling of PLC-programs by High-level Coloured Petri Nets
Iosif Itkin
 
TMPA-2017: The Quest for Average Response Time
Iosif Itkin
 
TMPA-2017: Evolutionary Algorithms in Test Generation for digital systems
Iosif Itkin
 
TMPA-2017: Layered Layouts for Software Systems Visualization
Iosif Itkin
 
TMPA-2017: Functional Parser of Markdown Language Based on Monad Combining an...
Iosif Itkin
 
TMPA-2017: Predicate Abstraction Based Configurable Method for Data Race Dete...
Iosif Itkin
 
TMPA-2017: Dl-Check: Dynamic Potential Deadlock Detection Tool for Java Programs
Iosif Itkin
 
TMPA-2017: Extended Context-Free Grammars Parsing with Generalized LL
Iosif Itkin
 
TMPA-2017: Simple Type Based Alias Analysis for a VLIW Processor
Iosif Itkin
 
TMPA-2015: The Verification of Functional Programs by Applying Statechart Dia...
Iosif Itkin
 
TMPA-2015: Implementing the MetaVCG Approach in the C-light System
Iosif Itkin
 
TMPA-2015: Formal Methods in Robotics
Iosif Itkin
 
TMPA-2015: ClearTH: a Tool for Automated Testing of Post Trade Systems
Iosif Itkin
 
Ad

Similar to TMPA-2017: Live testing distributed system fault tolerance with fault injection techniques (20)

PDF
Distributed Consensus: Making Impossible Possible [Revised]
Heidi Howard
 
PDF
Distributed Consensus: Making Impossible Possible
Heidi Howard
 
PDF
Distributed Consensus: Making Impossible Possible by Heidi howard
J On The Beach
 
PDF
Distributed Consensus: Making the Impossible Possible
C4Media
 
PDF
Consensus Algorithms: An Introduction & Analysis
Zak Cole
 
PPTX
Unit_4_Fault_Tolerance.pptx
rameshwarchintamani
 
PDF
Reaching reliable agreement in an unreliable world
Heidi Howard
 
PDF
From Mainframe to Microservice: An Introduction to Distributed Systems
Tyler Treat
 
PPTX
fault tolerance1.pptx
rithika858339
 
PPTX
slides.08.pptx
balewayalew
 
PPTX
Fault tol final ppt.pptx
SamanShaheen5
 
PPTX
Fault Tolerance in Distributed System
Yatru Harsha Hiski
 
PDF
Practical Byzantine Fault Tolernace
YongraeJo
 
PPTX
Fault tolerance in distributed systems
sumitjain2013
 
PDF
A Practical Fault Tolerance Approach in Cloud Computing Using Support Vector ...
BOHR International Journal of Smart Computing and Information Technology
 
ODP
Manging scalability of distributed system
Atin Mukherjee
 
PDF
CSL Seminar presented by Cassiano Campes - 17-03-13
Cassiano Campes
 
ZIP
9X5u87KWa267pP7aGX3K
CapitolPunishment
 
PPTX
p2 p grid
Yogeshwari M Yogi
 
PPT
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
reginamutio48
 
Distributed Consensus: Making Impossible Possible [Revised]
Heidi Howard
 
Distributed Consensus: Making Impossible Possible
Heidi Howard
 
Distributed Consensus: Making Impossible Possible by Heidi howard
J On The Beach
 
Distributed Consensus: Making the Impossible Possible
C4Media
 
Consensus Algorithms: An Introduction & Analysis
Zak Cole
 
Unit_4_Fault_Tolerance.pptx
rameshwarchintamani
 
Reaching reliable agreement in an unreliable world
Heidi Howard
 
From Mainframe to Microservice: An Introduction to Distributed Systems
Tyler Treat
 
fault tolerance1.pptx
rithika858339
 
slides.08.pptx
balewayalew
 
Fault tol final ppt.pptx
SamanShaheen5
 
Fault Tolerance in Distributed System
Yatru Harsha Hiski
 
Practical Byzantine Fault Tolernace
YongraeJo
 
Fault tolerance in distributed systems
sumitjain2013
 
A Practical Fault Tolerance Approach in Cloud Computing Using Support Vector ...
BOHR International Journal of Smart Computing and Information Technology
 
Manging scalability of distributed system
Atin Mukherjee
 
CSL Seminar presented by Cassiano Campes - 17-03-13
Cassiano Campes
 
9X5u87KWa267pP7aGX3K
CapitolPunishment
 
p2 p grid
Yogeshwari M Yogi
 
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
reginamutio48
 
Ad

More from Iosif Itkin (20)

PDF
Foundations of Software Testing Lecture 4
Iosif Itkin
 
PPTX
QA Financial Forum London 2021 - Automation in Software Testing. Humans and C...
Iosif Itkin
 
PDF
Exactpro FinTech Webinar - Global Exchanges Test Oracles
Iosif Itkin
 
PDF
Exactpro FinTech Webinar - Global Exchanges FIX Protocol
Iosif Itkin
 
PDF
Operational Resilience in Financial Market Infrastructures
Iosif Itkin
 
PDF
20 Simple Questions from Exactpro for Your Enjoyment This Holiday Season
Iosif Itkin
 
PDF
Testing the Intelligence of your AI
Iosif Itkin
 
PDF
EXTENT 2019: Exactpro Quality Assurance for Financial Market Infrastructures
Iosif Itkin
 
PDF
ClearTH Test Automation Framework: Case Study in IRS & CDS Swaps Lifecycle Mo...
Iosif Itkin
 
PPTX
EXTENT Talks 2019 Tbilisi: Failover and Recovery Test Automation - Ivan Shamrai
Iosif Itkin
 
PDF
EXTENT Talks QA Community Tbilisi 20 April 2019 - Conference Open
Iosif Itkin
 
PDF
User-Assisted Log Analysis for Quality Control of Distributed Fintech Applica...
Iosif Itkin
 
PPTX
QAFF Chicago 2019 - Complex Post-Trade Systems, Requirements Traceability and...
Iosif Itkin
 
PDF
QA Community Saratov: Past, Present, Future (2019-02-08)
Iosif Itkin
 
PDF
Machine Learning and RoboCop Testing
Iosif Itkin
 
PDF
Behaviour Driven Development: Oltre i limiti del possibile
Iosif Itkin
 
PDF
2018 - Exactpro Year in Review
Iosif Itkin
 
PPTX
Exactpro Discussion about Joy and Strategy
Iosif Itkin
 
PPTX
FIX EMEA Conference 2018 - Post Trade Software Testing Challenges
Iosif Itkin
 
PDF
BDD. The Outer Limits. Iosif Itkin at Youcon (in Russian)
Iosif Itkin
 
Foundations of Software Testing Lecture 4
Iosif Itkin
 
QA Financial Forum London 2021 - Automation in Software Testing. Humans and C...
Iosif Itkin
 
Exactpro FinTech Webinar - Global Exchanges Test Oracles
Iosif Itkin
 
Exactpro FinTech Webinar - Global Exchanges FIX Protocol
Iosif Itkin
 
Operational Resilience in Financial Market Infrastructures
Iosif Itkin
 
20 Simple Questions from Exactpro for Your Enjoyment This Holiday Season
Iosif Itkin
 
Testing the Intelligence of your AI
Iosif Itkin
 
EXTENT 2019: Exactpro Quality Assurance for Financial Market Infrastructures
Iosif Itkin
 
ClearTH Test Automation Framework: Case Study in IRS & CDS Swaps Lifecycle Mo...
Iosif Itkin
 
EXTENT Talks 2019 Tbilisi: Failover and Recovery Test Automation - Ivan Shamrai
Iosif Itkin
 
EXTENT Talks QA Community Tbilisi 20 April 2019 - Conference Open
Iosif Itkin
 
User-Assisted Log Analysis for Quality Control of Distributed Fintech Applica...
Iosif Itkin
 
QAFF Chicago 2019 - Complex Post-Trade Systems, Requirements Traceability and...
Iosif Itkin
 
QA Community Saratov: Past, Present, Future (2019-02-08)
Iosif Itkin
 
Machine Learning and RoboCop Testing
Iosif Itkin
 
Behaviour Driven Development: Oltre i limiti del possibile
Iosif Itkin
 
2018 - Exactpro Year in Review
Iosif Itkin
 
Exactpro Discussion about Joy and Strategy
Iosif Itkin
 
FIX EMEA Conference 2018 - Post Trade Software Testing Challenges
Iosif Itkin
 
BDD. The Outer Limits. Iosif Itkin at Youcon (in Russian)
Iosif Itkin
 

Recently uploaded (20)

PDF
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
 
PDF
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PPTX
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
PDF
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
PDF
From Chatbot to Destroyer of Endpoints - Can ChatGPT Automate EDR Bypasses (1...
Priyanka Aash
 
PDF
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
PDF
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
PDF
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
PDF
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
PPTX
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
PDF
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
ScyllaDB
 
EIS-Webinar-Engineering-Retail-Infrastructure-06-16-2025.pdf
Earley Information Science
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
Plugging AI into everything: Model Context Protocol Simplified.pdf
Abati Adewale
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
ScyllaDB
 
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
From Chatbot to Destroyer of Endpoints - Can ChatGPT Automate EDR Bypasses (1...
Priyanka Aash
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
2025_06_18 - OpenMetadata Community Meeting.pdf
OpenMetadata
 
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
“MPU+: A Transformative Solution for Next-Gen AI at the Edge,” a Presentation...
Edge AI and Vision Alliance
 
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
Kubernetes - Architecture & Components.pdf
geethak285
 

TMPA-2017: Live testing distributed system fault tolerance with fault injection techniques

  • 1. [ ИМИДЖЕВОЕ ИЗОБРАЖЕНИЕ ] Live Testing of Distributed System Fault Tolerance With Fault Injection Techniques Alexey Vasyukov, Inventa Vadim Zherder, Moscow Exchange
  • 2. Plan • Introduction Distributed Trading System concepts • Distributed Consensus protocol • MOEX Fault Injection testing framework 2
  • 5. Transactions Processing • One incoming stream • Strictly ordered FIFO incoming stream • SeqNum • TimeStamp • Strictly ordered FIFO outcoming stream • Each transaction should get reply • No loss, no duplicates • Multistage processing • No 1 – finished, No 2,3 – in process, No 4 - incoming • Transaction processing result • ErrorCode, Message, Statuses, … • TransLog = Transactions Log • Transaction buffer • Large but finite. When exhausted, TS stops processing transactions and become “unavailable” 5
  • 7. Messaging 7 UP – transactions DOWN – responses and messages to nodes of the cluster Use CRC (Cyclic redundancy check) to control transaction flow Full history: “Late join” is possible
  • 8. Role: “Main” “Main” = the main TS instance • Get new transactions from incoming stream • Broadcast transactions within cluster • Process transactions • Check transaction result (compare to results obtained from other nodes) • Broadcast results within cluster • Publish replies to clients 8
  • 9. Role: “Backup” “Backup” = a special state of TS instance • Can be switched to Main quickly • Get all transactions from Main • Process transactions independently • Check transaction result (compare to results from other nodes) • Write its own TransLog • Do not send replies to clients 9
  • 10. Role: “Backup” 2 modes: SYNC (“Hot Backup”) and ASYNC (“Warm Backup”) 10 If Main failed, SYNC can switch to Main automatically SYNC publish transaction results If SYNC failed, ASYNC can switch to SYNC automatically ASYNC does not publish transaction result ASYNC can be switched to Main manually by Operator Number of SYNCs is a static parameter determined by Operator
  • 11. Role: Governor 11 Governor can • Force node to change its role • Force node to stop • Start Elections to assign new Main Only one Governor in the cluster Governor can be assigned only by Operator Governor role cannot be changed If some node asks Governor but it is unavailable then this node stalls until it recovers connectivity to the Governor Governor can be recovered or restarted only by Operator
  • 12. Roles Summary 12 Governor Main SYNC Backup ASYNC Backup Send Table of states V V V V Get Client Transaction V Broadcast Transaction V Process Transaction V V V Broadcast Transaction result V V Compare transaction results V V V Send replies to clients V Can Switch to Main SYNC
  • 13. If something goes wrong… 13 IF we detect • Mismatch in transaction result • A node does not respond • No new transactions incoming • Wrong CRC • Governor does not response • Mismatch in tables of states • … THEN ASK Governor
  • 14. Elections 14 Elections Starts to assign new Main Stop transaction processing 2-fold Generation counter (G:S) Initial values (0:0) Every successful election increases G and drop S to 0 (G:0). Every round of elections increases S Example: (1:0) -> (1:1) -> (1:2) -> (2:0) Generation counter in every message to/from Governor 2-Phase commit approach Governor sends new table of states and waits for confirmation from all nodes
  • 16. MOEX Consensus Protocol (by Sergey Kostanbaev, MOEX) 16 We must provide Tables of state to be consistent at all nodes during normal work period We must provide Tables of state to become consistent after some nodes failed Node 1 Node 2 Node 3 Node 4 uuid1 S_MAIN S_GOVERNOR S_BACKUP_SYNC S_BACKUP_ASYNC uuid2 S_MAIN S_GOVERNOR S_BACKUP_SYNC S_BACKUP_ASYNC uuid3 S_MAIN S_GOVERNOR S_BACKUP_SYNC S_BACKUP_ASYNC uuid4 S_MAIN S_GOVERNOR S_BACKUP_SYNC S_BACKUP_ASYNC Table of States at each node
  • 17. MOEX Consensus Protocol 17 Thus, it is an example of a Distributed consensus protocol Other examples: • Paxos, 1998, 2001, … LAMPORT, L. Paxos made simple. ACM SIGACT News 32, 4 (Dec. 2001), 18–25. • RAFT, 2014 https://raft.github.io/raft.pdf ONGARO, D., AND OUSTERHOUT, J. In search of an understandable consensus algorithm. In Proc ATC’14,USENIX Annual Technical Conference (2014), USENIX • DNCP, 2016 https://tools.ietf.org/html/rfc7787 Open questions: Is MOEX CP equivalent to any of known protocols? Hypothesis on MOEX CP features H1. Byzantine fault tolerance H2. Safety H3. No liveness
  • 18. Cluster Normal State Requirements 18 • There is exactly 1 Governor in the cluster • There is exactly 1 Main in the cluster • Tables of states at all nodes are consistent • All active nodes in the cluster have the same value of Generation Counter • The cluster is available (for client connection) and process transactions • All nodes process the same sequence of transactions • Either number of SYNCs equals to the predefined value, or it is less than predefined value and there is no ASYNCs …
  • 19. Main “Theorem” 19 • Assume that the cluster was in Normal state, and one of Main or Backup node fails. Then the cluster goes back to Normal state during finite time.
  • 20. MOEX CP Testing 20 Investigate • Fault detection • Implementation correctness • Timing • Dependence on load profile • Dependence on environment configuration • Statistics Integration with CI/CD processes
  • 21. Typical Test Scenario 21 1. Start all 2. Wait for normal state 3. Start transactions generator 4. Keep transactions flow for some time 5. Fault injection – emulate fault (single or multiple) 6. Wait for normal state (check timeout) 7. Check state at each node 8. Get artifacts
  • 22. References 22 WIDDER J., Introduction into Fault-tolerant Distributed Algorithms and their Modeling, TMPA (2014) LAMPORT, L. Paxos made simple. ACM SIGACT News 32, 4 (Dec. 2001), 18–25. https://raft.github.io/raft.pdf ONGARO, D., AND OUSTERHOUT, J. In search of an understandable consensus algorithm. In Proc ATC’14,USENIX Annual Technical Conference (2014), USENIX ONGARO D. Consensus: Bridging theory and practice : Doctoral dissertation – Stanford University, 2014.
  • 24. Fault Injection: Testing Implementation 24
  • 25. MOEX Fault Injection Framework Concepts • End-to-end testing of cluster implementation • Starts complete real system on real infrastructure • Provides modules to inject predictable faults on selected servers • Provides domain specific libraries to write tests • System, network, app issues are injected directly • Misconfiguration problems are tested indirectly (real infrastructure, config push before test start) 25
  • 27. Inject Techniques OS Processes • Kill (SIGKILL) • Hang (SIGSTOP for N seconds + SIGCONT) Network • Interface “blink” (DROP 100% packets for N seconds) • Interface “noise” (DROP X% packets for N seconds) • Content filtering – allows “smart” inject into protocol, dropping selected messages from the flow Application • Data corrupt (with gdb script) – emulates application level issues from incorrect calculation 27
  • 28. Basic Cluster State Validations 28 # Code Description 00 ALIVE_ON_START Cluster nodes should start correctly 01 SINGLE_MAIN Only one node should consider itself MAIN 02 GW_OK All gateways should be connected to correct MAIN 03 GEN_OK All active cluster nodes should have the same generation 04 TE_VIEW_OK Current MAIN should be connected to all alive nodes 05 CLU_VIEW_CONSISTENT All alive nodes should have the same cluster view 06 ELECTIONS_OK Elections count during the test should match inject scenario 07 DEAD_NODES_OK The number of lost nodes should match inject scenario 08 CLIENTS_ALIVE Clients should not notice any issue, fault handling logic is completely hidden from them
  • 29. Test Targets • Basic system faults • Multiple system faults on different nodes • Application level faults • Random network instabilities • Recovery after faults • Governor stability (failures, restarts, failures during elections) 29
  • 30. Test Summary 30 Logs from all nodes for root cause analysisCluster state validations summary Cluster nodes states (Sync Backup is dead, Async Backup switched to Sync)
  • 31. Basic Fault: Overall System Behavior Event log timeline BS died, elections started Elections, no transactions Resumed operation
  • 32. Restore After Fault: Overall System Behavior BS hanged, elections started Elections, no transactions Resumed operation BS is alive again BS rejoins the cluster, receiving missed transactions
  • 33. Performance Metrics • Key performance data from all cluster nodes • How faults influence service quality for consumers? • Compare configurations (indirectly, together with config push) 33
  • 34. Domain Specific Language • Useful for ad-hoc tests and quick analysis • Complements set of 'default' tests (written in Python) 34
  • 35. Statistics • Multiple runs to identify problems without stable reproducers • Heatmap to analyze quickly both which tests and which validations fail 35
  • 36. References 36 Similar tools: 1. Netflix Simian Army; http://techblog.netflix.com/2011/07/netflix-simian-army.html 2. Jepsen; https://jepsen.io/ Reading: 1. Caitie McCaffrey. 2015. The Verification of a Distributed System. Queue 13, 9, pages 60 (December 2015), 11 pages. DOI=http://dx.doi.org/10.1145/2857274.2889274 2. Alvaro, P., Rosen, J. and Hellerstein, J.M. 2015. Lineage-driven fault injection. http://www.cs.berkeley.edu/~palvaro/molly.pdf 3. Yuan, D., Luo, Y., Zhuang, X., Rodrigues, G. R., Zhao, X., Zhang, Y., Jain, P. U., Stumm, M. 2014. Simple testing can prevent most critical failures: an analysis of production failures in distributed data-intensive systems; https://www.usenix.org/conference/osdi14/technical- sessions/presentation/yuan 4. Ghosh S. et al. 1997. Software Fault Injection Testing on a Distributed System – A Case Study 5. Lai, M.-Y., Wang S.Y. 1995. Software Fault Insertion Testing for Fault Tolerance. Software Fault Tolerance, Edited by Lyu, Chapter 13.