top of page

Create Your First Project

Start adding your projects to your portfolio. Click on "Manage Projects" to get started

Kernel Programming

Date

July 2023

Location

Arlington Texas

Project Description:
In this project, we have developed a fault-tolerant 2-Phase distributed commit (2PC) protocol. We introduced controlled and random failures to observe how the 2PC protocol handles node crashes. The system comprises one transaction coordinator (TC) and two participant nodes. We used multiple processes to emulate multiple nodes, and each node, including the TC and the participants, implements a time-out mechanism. If no response is received within the time-out period, the node transitions to either the abort or commit state. We evaluated the following possibilities of failures:
1. The TC fails before sending the “prepare” message.
2. The TC fails to receive “yes” from a node.
3. The TC fails after sending one “commit” message to the nodes.
4. A node fails after replying “yes” to the TC.

Implementation:
The implementation of the 2PC protocol has been written in Python. Sockets and threading module was
utilized to create and handle connections with multiple nodes concurrently.
We used the Python programming language to implement the 2PC protocol. To simulate numerous nodes as multiple processes, we used the multiprocessing module. Participants were implemented as independent processes, and the TC was implemented separately. We utilized sockets and threading.
The 2PC protocol consists of two steps – prepare and commit. The TC sends a “prepare” message to all the participant nodes. If TC receives a “yes” as a response from all the nodes, it sends out a “commit” message and the transaction is executed. If TC receives a “no” response from any of the participants, it aborts the transaction.

bottom of page