0% found this document useful (0 votes)
9 views3 pages

Session 35

Uploaded by

180050030ecm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views3 pages

Session 35

Uploaded by

180050030ecm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

SESSION-35

Lecture notes on Commit Protocols: Non-blocking Commit Protocols, Voting Protocols,


and Dynamic Voting in Advanced Operating Systems (AOS):

1. Introduction to Commit Protocols


 Definition: Commit protocols are algorithms used to ensure that a set of distributed
transactions either all commit (complete successfully) or all abort (fail), maintaining
consistency across a distributed system.
 Importance: These protocols are crucial in distributed databases and systems where
multiple processes must coordinate to achieve a consistent state despite failures.

2. Two-Phase Commit Protocol (2PC)


 Overview: A foundational commit protocol that guarantees atomicity in distributed
transactions.
 Phases:
1. Prepare Phase: The coordinator asks all participants if they can commit the
transaction. Participants respond with a “Yes” or “No.”
2. Commit Phase: If all participants respond “Yes,” the coordinator sends a
commit message; if any participant responds “No,” a rollback message is sent.
 Blocking Issue: 2PC can lead to blocking if the coordinator fails after participants
prepare but before receiving responses, leaving participants uncertain.

3. Non-blocking Commit Protocols


 Definition: Non-blocking commit protocols allow transactions to proceed without
being indefinitely blocked, even in the event of coordinator failure.
 Characteristics:
o Ensure that participants can make progress without waiting for the
coordinator.
o Can use alternative strategies to resolve the commitment decision.
 Examples:
o Three-Phase Commit Protocol (3PC): An improvement over 2PC that adds a
third phase to reduce blocking risks by introducing a "Can Commit" phase
before the final commit phase.
 Phases:
1. Can Commit Phase: The coordinator asks if participants can
commit.
2. Prepare Phase: If all participants respond positively, the
coordinator prepares the transaction.
3. Commit Phase: Participants commit if they receive the prepare
message.
o Presumed Commit Protocol: Participants can presume a commit when they
do not receive a response from the coordinator within a certain timeframe,
allowing them to proceed independently.

4. Voting Protocols
 Definition: Voting protocols involve participants voting on whether to commit or
abort a transaction, ensuring that a majority decision dictates the outcome.
 Types:
o Basic Voting Protocol: Each participant votes on the transaction and sends the
result to the coordinator. A majority vote decides the outcome.
o Weighted Voting Protocol: Participants have different weights based on their
importance. The outcome is determined by weighted votes.
 Advantages:
o Can handle failures more gracefully since decisions are based on participant
consensus.
o Reduces the risk of blocking by allowing multiple participants to make
independent decisions.

5. Dynamic Voting
 Definition: Dynamic voting allows the voting configuration to change based on
system conditions or participant availability. It provides flexibility in decision-
making.
 Characteristics:
o Participants can join or leave the voting process dynamically.
o The voting weights or counts can be adjusted based on the current system
state.
 Advantages:
o Increases resilience against failures by adapting to the availability of
participants.
o Helps maintain consensus even in fluctuating system conditions.
 Use Cases: Suitable for large-scale distributed systems, such as cloud computing
environments, where participant availability may vary.

6. Challenges with Commit Protocols


 Complexity: Designing and implementing commit protocols that ensure consistency
while minimizing blocking and failure susceptibility can be complex.
 Performance Overhead: Commit protocols can introduce latency due to the
coordination needed among distributed participants.
 Scalability: Ensuring efficient operation as the number of participants increases can
be challenging, especially in dynamic environments.

7. Applications of Commit Protocols


 Distributed Databases: Ensuring data integrity and consistency across multiple
database nodes during transaction processing.
 Cloud Computing: Managing distributed applications where multiple components
must agree on transaction outcomes.
 Real-time Systems: Coordinating actions across systems that require timely and
consistent responses.

8. Conclusion
 Commit protocols are essential for maintaining consistency in distributed systems,
allowing transactions to complete or fail gracefully.
 Non-blocking and voting protocols offer solutions to common challenges faced in
distributed transaction management.
 Understanding these protocols is crucial for designing robust systems capable of
handling failures while ensuring data integrity.

You might also like