Podcast
Questions and Answers
What is the main problem that the Paxos algorithm addresses?
What is the main problem that the Paxos algorithm addresses?
- Remove all non-Byzantine faults
- Increase message transmission speed
- Ensure all processors are always operational
- Define a total order of clients’ requests (correct)
Paxos ensures the system can progress with any majority of processors functioning.
Paxos ensures the system can progress with any majority of processors functioning.
True (A)
What is the core function of the Paxos algorithm?
What is the core function of the Paxos algorithm?
Consensus algorithm
Paxos addresses issues caused by __________ failures and recoveries.
Paxos addresses issues caused by __________ failures and recoveries.
Match the following concepts related to Paxos with their descriptions:
Match the following concepts related to Paxos with their descriptions:
What is the primary purpose of vector clocks in distributed systems?
What is the primary purpose of vector clocks in distributed systems?
Causal requests are propagated in the background in distributed systems.
Causal requests are propagated in the background in distributed systems.
Who is the author of 'The Part-Time Parliament'?
Who is the author of 'The Part-Time Parliament'?
The Paxos algorithm is described in terms of a ___________ on an ancient Greek island.
The Paxos algorithm is described in terms of a ___________ on an ancient Greek island.
Match the following individuals with their contributions related to Paxos:
Match the following individuals with their contributions related to Paxos:
What year did Leslie Lamport submit his paper to TOCS?
What year did Leslie Lamport submit his paper to TOCS?
The referees of Lamport's paper considered it very important.
The referees of Lamport's paper considered it very important.
Which publication included 'The Part-Time Parliament'?
Which publication included 'The Part-Time Parliament'?
What is the main purpose of replication in distributed systems?
What is the main purpose of replication in distributed systems?
In a replicated state machine, all replicas execute the input commands in different orders.
In a replicated state machine, all replicas execute the input commands in different orders.
What is the characteristic that mandates determinism in replicated state machines?
What is the characteristic that mandates determinism in replicated state machines?
A replicated state machine is also called a __________ approach.
A replicated state machine is also called a __________ approach.
Match the following types of replication with their descriptions:
Match the following types of replication with their descriptions:
What is a key property that all servers must share in a replicated state machine?
What is a key property that all servers must share in a replicated state machine?
Fault tolerance is more challenging to achieve with active replication compared to passive replication.
Fault tolerance is more challenging to achieve with active replication compared to passive replication.
What does the term 'total order' refer to in the context of replicated state machines?
What does the term 'total order' refer to in the context of replicated state machines?
In a distributed system, a client perceives the service as coming from a single __________.
In a distributed system, a client perceives the service as coming from a single __________.
Which of the following describes the initial state condition (SMR1) for replicated state machines?
Which of the following describes the initial state condition (SMR1) for replicated state machines?
For crash model input dissemination, how many replicas are generally needed?
For crash model input dissemination, how many replicas are generally needed?
Output consolidation in a BFT model requires 2f + 1 replicas.
Output consolidation in a BFT model requires 2f + 1 replicas.
What is another name for primary-backup replication?
What is another name for primary-backup replication?
In the event of a primary failure, a ______ takes over in primary-backup replication.
In the event of a primary failure, a ______ takes over in primary-backup replication.
Match the type of replication with its description:
Match the type of replication with its description:
What is the main issue with non-deterministic replicas?
What is the main issue with non-deterministic replicas?
In prime-backup replication, only the Primary receives requests from clients.
In prime-backup replication, only the Primary receives requests from clients.
What is the potential consequence of a backup taking over after a primary failure?
What is the potential consequence of a backup taking over after a primary failure?
The primary in primary-backup replication ensures that backups receive state updates before sending a reply to the ______.
The primary in primary-backup replication ensures that backups receive state updates before sending a reply to the ______.
What fault model allows the Primary to send updates without waiting for confirmations from Backups?
What fault model allows the Primary to send updates without waiting for confirmations from Backups?
In semi-active replication, the leader executes all commands and followers wait for the leader's command.
In semi-active replication, the leader executes all commands and followers wait for the leader's command.
How does lazy replication handle replica consistency?
How does lazy replication handle replica consistency?
Total order broadcast is used to ensure a deterministic order in ______ replication.
Total order broadcast is used to ensure a deterministic order in ______ replication.
What triggers a backup to elect a new primary?
What triggers a backup to elect a new primary?
What is the role of the leader in the Paxos algorithm?
What is the role of the leader in the Paxos algorithm?
A new leader is elected only when the current leader is confirmed to be crashed.
A new leader is elected only when the current leader is confirmed to be crashed.
What is needed for progress in the Paxos algorithm?
What is needed for progress in the Paxos algorithm?
In the Paxos algorithm, a server accepts a sequence number when it receives _____ ACCEPT messages.
In the Paxos algorithm, a server accepts a sequence number when it receives _____ ACCEPT messages.
Match the following Paxos roles with their functions:
Match the following Paxos roles with their functions:
What happens if multiple leaders are active at the same time?
What happens if multiple leaders are active at the same time?
The Paxos algorithm can execute two different requests with the same sequence number.
The Paxos algorithm can execute two different requests with the same sequence number.
What happens when a server crashes and recovers?
What happens when a server crashes and recovers?
When a timer expires, a server suspects the leader is faulty and sends a _____ message.
When a timer expires, a server suspects the leader is faulty and sends a _____ message.
What is the purpose of the PREPARE message sent by a new leader?
What is the purpose of the PREPARE message sent by a new leader?
Once a leader is elected, it can always stay as the leader without any failures.
Once a leader is elected, it can always stay as the leader without any failures.
How does the Paxos algorithm ensure liveness?
How does the Paxos algorithm ensure liveness?
The algorithm guarantees that execution happens in order of the _____ number.
The algorithm guarantees that execution happens in order of the _____ number.
Match the following terms to their definitions:
Match the following terms to their definitions:
Flashcards
Client-Server Model in Replication
Client-Server Model in Replication
A model for distributing services, where multiple servers provide the same service, and clients interact with it as if talking to a single entity.
State in Replication
State in Replication
In replication, a set of variables representing the current state of the system.
State Machine Approach
State Machine Approach
A way to organize computations where commands are applied sequentially, and each command modifies the system's state and generates outputs.
Replicated State Machine (RSM)
Replicated State Machine (RSM)
Signup and view all the flashcards
Error Masking in RSM
Error Masking in RSM
Signup and view all the flashcards
Determinism in RSM
Determinism in RSM
Signup and view all the flashcards
Total Order of Commands in RSM
Total Order of Commands in RSM
Signup and view all the flashcards
Atomic Broadcast
Atomic Broadcast
Signup and view all the flashcards
SMR1: Initial State
SMR1: Initial State
Signup and view all the flashcards
SMR2: Agreement
SMR2: Agreement
Signup and view all the flashcards
Paxos
Paxos
Signup and view all the flashcards
Two-Phase Commit
Two-Phase Commit
Signup and view all the flashcards
Proposer
Proposer
Signup and view all the flashcards
Acceptor
Acceptor
Signup and view all the flashcards
Replication
Replication
Signup and view all the flashcards
Consensus
Consensus
Signup and view all the flashcards
Fault tolerance
Fault tolerance
Signup and view all the flashcards
High availability
High availability
Signup and view all the flashcards
Crash Failures
Crash Failures
Signup and view all the flashcards
Total Order of Clients' Requests
Total Order of Clients' Requests
Signup and view all the flashcards
Partial Synchrony
Partial Synchrony
Signup and view all the flashcards
Paxos for System Builders (PSB)
Paxos for System Builders (PSB)
Signup and view all the flashcards
Replicated State Machine
Replicated State Machine
Signup and view all the flashcards
Number of Replicas
Number of Replicas
Signup and view all the flashcards
Primary Back-up Replication
Primary Back-up Replication
Signup and view all the flashcards
Active Replication
Active Replication
Signup and view all the flashcards
Preemption in Active Replication
Preemption in Active Replication
Signup and view all the flashcards
Semi-active Replication
Semi-active Replication
Signup and view all the flashcards
Lazy Replication
Lazy Replication
Signup and view all the flashcards
Fault Tolerance in Replicated Systems
Fault Tolerance in Replicated Systems
Signup and view all the flashcards
Non-deterministic Replica Behavior
Non-deterministic Replica Behavior
Signup and view all the flashcards
Input Dissemination
Input Dissemination
Signup and view all the flashcards
Output Consolidation
Output Consolidation
Signup and view all the flashcards
Crash Fault Model
Crash Fault Model
Signup and view all the flashcards
Byzantine Fault Model
Byzantine Fault Model
Signup and view all the flashcards
Leader in Paxos
Leader in Paxos
Signup and view all the flashcards
Quorum in Paxos
Quorum in Paxos
Signup and view all the flashcards
Committing a Message in Paxos
Committing a Message in Paxos
Signup and view all the flashcards
Leader Election in Paxos
Leader Election in Paxos
Signup and view all the flashcards
VIEW-CHANGE Message in Paxos
VIEW-CHANGE Message in Paxos
Signup and view all the flashcards
Preparing Next Sequence Number in Paxos
Preparing Next Sequence Number in Paxos
Signup and view all the flashcards
PREPARE Message in Paxos
PREPARE Message in Paxos
Signup and view all the flashcards
PREPARE-OK Message in Paxos
PREPARE-OK Message in Paxos
Signup and view all the flashcards
Study Notes
Algorithmic Foundation - Distributed Algorithms
- Chapter 6 covers Basics of Replication and Paxos.
Chapter Overview
- Replication:
- State machine and active replication
- Passive and primary backup replication
- Semi-active and lazy replication
- Paxos:
- Background
- Algorithm
Replication
-
Client-server model:
- Service provided by server(s) is replicated across several servers
- Client interacts as if it's contacting a single server
- If a replica fails, the service continues unaffected.
-
Replicated State Machine:
- Active replication approach
- All servers start in the same initial state
- All replicas execute the same commands in the same order
- Same sequence of state/output
-
Replicated state machine:
- Error masking
- Deterministic
- Message ordering (total order of commands to replicas)
-
Properties that specify the problem:
- SMR1 Initial state (all servers start in the same state)
- SMR2 Agreement (all servers execute the same commands)
- SMR3 Total order (all servers execute the commands in the same order)
-
Agreement and total order implies atomic broadcast
-
Broadcast to whom? Only to servers involved
-
Client-server protocol:
- Send to all servers then all atomically broadcast OR
- Send to one server, then it broadcasts, and if no reply in timeout, broadcast to more servers
- Servers send output to client which consolidates it.
-
Number of servers:
- Crash model: Typically 2f + 1 replicas (f + 1 in specific cases)
- BFT model: Typically 3f + 1 replicas
- In crash model, f + 1 replicas ensure correct output (single reply required)
- In BFT model, 2f + 1 replicas guarantee majority voting
-
Problems with replicated computation:
- Non-deterministic component (state and behavior depend on local parameters)
- Non-deterministic programming constructs
- Scheduling decisions
- Shared resources
- Clocks, random numbers
Replication - Primary Backup
-
Also known as passive replication
-
Only primary executes commands and determines order
-
Uses leader-election algorithm (no atomic broadcast)
-
Supports preemption and non-determinism (active replication doesn't support this)
-
State is transferred to back-ups
-
Backups log commands until a checkpoint is received.
-
Primary fails: Backup takes over
-
Potentially long takeover glitch
-
Non-ordered message diffusion
-
Algorithm (Primary):
- Execute the request
- Forward state updates (if any) to backups
- Send reply to client
-
Algorithm (Backups):
- Store request in log
- Update state and handle corresponding request based on log.
- Detect primary failure; elect a new primary
- Execute and reply to any requests in the log (if elected as new primary).
-
Fault model is important - reliable network or network commits omission faults (state update messages might get lost). Client confirmation needed from backups.
-
Alternative
- Use total-order broadcast for requests and assume deterministic replicas.
-Sufficient to send state updates only periodically.
- Use total-order broadcast for requests and assume deterministic replicas.
Replication - Semi-active
- All servers execute, but leader defines the order first
- Supports per-message deterministic preemption (e.g., urgent command messages).
- Commands transferred to followers.
- Leader informs followers of the next command or command sequence
- Leader fails: Follower takes over
- Short takeover-glitch
- Non-ordered message diffusion (needs leader election algorithm)
Replication - Lazy (optimistic)
-
Replicas eventually become consistent if everything goes well.
-
Trade consistency for performance.
-
Allows client requests to different copies.
-
Replicas allowed to diverge in inconsistent states.
-
Full consistency only guaranteed when the system is idle.
-
Addressing conflicts
-
Vector clocks used to ensure causal ordering and handle those commands that don't need total order.
-
Synchronization among replicas when total order is needed
-
Causal requests are processed in the background.
Paxos
-
Background:
- From Leslie Lamport's paper
- Part time Parliament (used to popularize the consensus problem idea).
- Published with many delays.
-
Literature:
- Lamport's work and other papers
- Various papers/publications on Paxos
Paxos - Why Paxos Matters
- Solves active replication despite any number of crash failures and recoveries.
- Main problem: define a total order of client requests.
- Core is a consensus algorithm.
- Variations/improvements by Lamport and others.
Paxos - System Model
- Links do not corrupt messages but may omit some.
- Handles crash failures and recoveries
- Algorithm is safe even if the system is asynchronous
Paxos - Main Concept
- Fixed number of servers
- Leader assigns sequence numbers to client requests
- If leader suspected of crashing, a new one is elected.
- Quorum is needed for progress ([N/2] + 1 servers)
- Algorithm considered proposers, acceptors, learners; alternative (PSB): all roles played by all servers.
Paxos - Main Concept: More Details
- Leader periodically commits messages.
- Operation failures due to crashed processes or lost messages.
- If leader changes, the new leader uses a new view number.
- Unreliable failure detection might lead to multiple active leaders.
- Algorithm ensures messages committed by multiple leaders are identical.
Paxos - Normal Case Operation
- Client sends update to leader
- Leader sends proposal to other servers
- Servers respond with accept messages
- Client gets reply after the update is executed.
- Proposal messages contain the sequence number
Paxos - Normal Case Operation: (Continued)
- Sequence number is accepted when [N/2] + 1 accept messages are received.
- Execution is done in order of sequence numbers.
- Network may reorder messages, early requests wait for late ones.
- Servers may crash and recover.
- On recovery, servers know their state.
- Leader must synchronize to disk before sending proposals
- Other servers must sync to disk before sending accepts.
Paxos - Leader Failure
- Leader election is necessary
- Prepare next sequence number (finding the last sequence number assigned by previous leader is critical).
Paxos - Leader Failure: Election
- Server restarts timer after each request execution.
- If timer expires (no requests), server suspects leader and sends a view-change message.
- ViewChange message includes the next view number.
- When receiving [N/2] + 1 view-change messages, a new leader is selected (V mod N).
- Partial synchronous time model, Timeout increased each time.
Paxos - Leader Failure: Prepare Next Sequence Number
- After election, new leader sends prepare message to all servers.
- Asking for the last request they accepted.
- Servers reply with prepare-ok (promising not to accept earlier proposals).
- This step ensures that proposal is not conflicting with something previously accepted.
- This is done immediately before syncing to disk.
Paxos - Leader Failure: Prepare Next Sequence Number (Continued)
- Leader receives replies from majority of servers.
- Leader picks the highest sequence number, adds 1 and sets it as the next.
- Moves to normal case operation
Paxos - Leader Change
- Example of leader sending proposal and subsequently crashing.
- S1 and S2 execute request and S1 becomes the new leader.
Paxos - Missing Requests
- Messages may be omitted so a server may receive request r without r - 1
- Execution is stopped for pending messages which are missing
Paxos - Recovery
- When a server recovers it restores its state from disk and starts leader election.
- May wait time to restart requests.
Paxos - Ensuring Safety
- Not possible to execute 2 different requests with the same sequence number in the same view.
- At least [N/2] + 1 servers have to accept (incl. 1 propose)
- Not possible to execute a request without executing previous requests imposed by local servers.
Paxos - Ensuring Liveness
- Progress depends on ability to elect a leader and quorum ([N/2]+1).
- Network stability requirement of the leader election protocol (defined formally)
Paxos - Implementation
- Issues such as UDP+IP multicast or TCP/IP, flow control, timeouts ("large" or "short"), and aggregation (batching)
- Some results with PSB.
Paxos - Implementation: Throughput (without aggregation)
- Figures showing update throughput (updates/sec) versus number of clients, for different numbers of servers.
Paxos - Implementation: Throughput (with aggregation)
- Figures showing update throughput with aggregation, versus number of clients, for different numbers of servers.
Paxos - Implementation: Latency
- Figures showing update latency (seconds or milliseconds) versus number of clients, for different numbers of servers.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.