Git Product home page Git Product logo

dsa-p2's Introduction

DSA-P2

Distributed Systems & Algorithms Project 2

Useful links

Project Prompt

ZooKeeper Slides

ZooKeeper’s atomic broadcast protocol: Theory and practice

Leader Election algorithms (we are using the Bully algorithm)

Order of events

  • Upping all servers individually
  • All upped servers start two listeners
  • One listener for client on client_port
  • One listener for server connections on server_port
  • Client sends "start" to one server
  • Server that receives "start" broadcasts election start to other servers
  • For now, it can just broadcast "I am your leader"
  • When a server receives a "leader is #" message
  • Stop server listener
  • Leader server runs "lead_connections" and other servers run "leader_listener"
  • After connections are formed, re-initialize listener for server

Config file formatting:

[Server number] [Server IP] [server_port] [leader_port] [client_port]

Testing

Run 3 servers with

$ . ./test_scripts/run3.sh

Run test case with

$ python cli_client.py <server-host> <server-client-port>  <  <input-file>

Kill the running servers with

$ . ./test_scripts/kill.sh

Message types

For requesting and committing transactions

['transaction_request', operation, epoch-string, counter-string, originator-num] - follower requests a transaction to leader
['transaction_proposal', transaction-string, epoch-string, counter-string, originator-num] - transaction proposal from leader to followers
['transaction_acknowledge', transaction-string, epoch-string, counter-string, originator-num] - trasaction accept/acknowledge from follower to the leader
['transaction_commit', transaction-string, epoch-string, counter-string, originator-num] - leader committing a transaction to the followers

For elections

['election', server-number, epoch-string, counter-string] - Initiating election
['higher_id', server-number, epoch-string, counter-string] - Response to election
['lower_id', server-number, epoch-string, counter-string] - Response to election
['coordinator', server-number, epoch-string, counter-string] - Become coordinator

TODO:

  • Elections
  • two-phase commits
  • Rebuild recovered server from written history & downloaded history

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.