Coder Social home page Coder Social logo

raft's People

Contributors

mransan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

vbmithr

raft's Issues

Use map in protobuf message for receiver id based data

Currently the LeaderState is a list of index. A subset of operations are querying this data structure by receiver id so it would make sense to use map. So far we only have a very limited number of servers so not worth it.

Add notification to the client application

Raft_logic.Message.handle_message and Raft_logic.Message.handle_timeout should be able to return notification. For instance:

  • New_leader (leader id)
  • No_more_leader
  • New_commit_index (from, to)

Add test for really delayed Append Entries request

  • Ti commit_index = x , prev_log_index x + 10
  • Ti+1 request with leader_commit = x + 20 , and 100 logs added
  • Ti+2 commit_index = x + 20, prev_log_index x + 110
  • Ti+3 duplicate of Ti+1 request
  • We can see now that commit_index > prev_log_index

Add a client ID to the log data

The data in the LogEntry is not enough. We should also add a client_id field to map the index (which is internal to the RAFT protocol) back to a client identifier. This is necessary for a RAFT application to know which data was appended to the log after it was commited.

Add log storage

Logs can be stored permanently by the client application. This is needed in order to be able to handle a very large number of logs.

One possible design which would keep this library pure computation is to modify the LogInterval type used in the global_cache.

Current version

message LogInterval {
  required int32    prev_index      = 1; 
  required int32    prev_term       = 2; 
  repeated LogEntry rev_log_entries = 3;  
  required int32    last_index      = 4;
}

Proposition

message LogInterval {
  required int32    prev_index      = 1; 
  required int32    prev_term       = 2; 
  required int32    last_index      = 4;
  message Compacted { } 
  message Expanded   {
    repeated LogEntry rev_log_entries = 1;  
  }
  oneof data {
    Compacted compacted = 5;
    Expanded   expanded   = 6;
  }
}

The client application would then be able to compact certain log interval. The major difficulty is in the recovery scenario (ie when a follower is lagging behind drastically). When computing the AppendEntries request the leader will find out tha the logs have been compacted. One possible solution is to augment the interface with the application to indicate that loading the data should happen.

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.