You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository contains a simple RAFT consensus algorithm with leader lease implemented as part of the CSE530 course offered at IIIT-D.
Use the files node.py and client.py to run the RAFT algorithm locally.
Use the files gcp-node.py and gcp-client.py to run the RAFT algorithm on Google Cloud Platform (or any other cloud instance).
Team Members: Jaskaran Singh, Gautam Reddy
Introduction
Raft is a consensus algorithm designed to be easy to understand. Raft divides time into terms, and each term begins with an election to select a leader. The leader manages the replication of the log entries to the other servers and ensures a high degree of consistency.
This implementation of RAFT also employs leader lease for optimized read only queries. Leases can be considered as tokens that are valid for a certain period of time, known as lease duration. A node can serve read and write requests from the client if and only if the node has this valid token/lease.
For a more detailed explanation please refer the following page.
Remote Procedure Calls (RPCs)
Raft servers communicate using remote procedure calls (RPCs), and the basic consensus algorithm requires only two types of RPCs.
RequestVote RPCs are initiated by candidates during elections.
AppendEntries RPCs are initiated by leaders to replicate log entries and to provide a form of heartbeat.
For this project, gRPC has been used to facilitate RPC functionality.
The RPCs utilized in this project are detailed in the below figure (Note: The RPCs contain slight modifications to incorporate the leader lease functionality):