Coder Social home page Coder Social logo

raft's People

Stargazers

 avatar

Watchers

 avatar  avatar

raft's Issues

Testing under network partition for Raft-Leader Election

Approaches I have used to perform this are listed below:-
There are 5 servers, i have used in configuration.

1)Server-1 and Server-2 are listening on 127.0.0.1 and Server-3,S-4 and Server-5 are listening on 10.99.99.137. Then used firewall iptables to stop communicating these two networks, by filtering based on ipaddr of src and dest. But this did not work because the OS knows that Both are lying within it, so when S-1(/ S-2) connects to S-3(/S-4/S-5) then it will use socket with address-port 10.99.99.137:xxxxx. This i have found using netstat command. I also stopped the communication between 2-interfaces (eth0 and lo) but this also failed due to same reason.

2)I tried to eth1(/wlan0) instead of lo, but this also failed due to above result.

3)Then I ran this on two different machines. and just remove LAN-cable, after some time attached it(Actually this seems obvious for this experiment but i have installed zmq4 on only one machine so at last i have to install it on other).

During this experiments i found some bugs like Servers timedout every time though they were not failed to listen
and
Use of isLeader() to decide whether leader already exists or not , This will works perfectly(unnoticed) for all servers are running under one process but this never happen in real.
I have solved these bugs.

In 3rd setup,filtering usingiptables undoubtedly works perfectly but removing cable is more easier to do.

Thank you.
-Mahendra
:-D

Review for assignment 3

This is a review for assignment 3.

  1. I loved the fact that you tested on multiple machines and attempted to induce all kinds of faults. Good job.

  2. Back to basics though. By "testing should be automated", I mean "automatic verification". It is one thing to induce faults, but equally important to verify automatically whether the code is running as expected; that means doing something with the testing.T parameter in TestRaft(). This is usually tougher than the code being tested.

  3. Servers and testing should always run silent. Logging should be done under an if-clause, and turned on only when debugging or monitoring something specific.

  4. raft.Start() -- A service should start on its own; it shouldn't require prodding from a test or some external bit of code to start.

  5. In Start(), a more compact replacement for the if-then-else- logic is

    switch serve.ServState.my_state {
      case follower: ...
      case leader: ...
      case candidate: ...
    }
    

    I'm using consts follower, leader, candidate instead of 0, 1, 2

  6. I'm not sure if splitting ServState into a separate struct buys you much. Also, what is the purpose of RaftType?

  7. isLeader(). A more compact version is return raft.Leader > 0.

  8. Is the time.Sleep() at line 180 a hook for the test framework to induce faults? If so, the name of the channel should be more appropriate; not 'ch'.

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.