Skip to content
/ 3PC Public

Implementation and an interactive demo of the three-phase commit (3PC) protocol.

Notifications You must be signed in to change notification settings

kwencel/3PC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Three-phase commit (3PC) demo

An implementation of a three-phase commit (3PC) protocol for transaction management in a distributed system.

This program simulates a protocol run on a distributed system with a user-defined number of nodes. It uses OpenMPI to provision such a system and serve as a medium of communication in this system.

You can force a certain node to crash by inputting its number (starting from 0) to STDIN and pressing ENTER. If you don't force any node to crash, the protocol should proceed successfully, and the program should exit.

Build prerequisites

CMake 3.9 (it will probably compile using older versions too, see the last paragraph)
C++17 compliant compiler
OpenMPI

Build instructions

git clone https://github.com/kwencel/3PC
cd 3PC
cmake .
make

How to use

Invoke compiled executables by mpirun with at least 2 processes, for example:

mpirun -np 3 3PC | tee log && clear && echo "----- SORTED LOG -----" && cat log | sort

It will run the program and stream the logs as they are generated. After the program completes however, it will display the log sorted by the messages lamport timestamp, which is crucial for analysing the program runtime.

Older CMake version?

Try to change the minimum required version in CMakeLists.txt to match the version you have installed. There shouldn't be any issues.

About

Implementation and an interactive demo of the three-phase commit (3PC) protocol.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published