Giter Club home page Giter Club logo

Comments (5)

github-actions avatar github-actions commented on June 19, 2024

👋 Thanks for opening this issue!

Get help or engage by:

  • /help : to print help messages.
  • /assignme : to assign this issue to you.

from openraft.

drmingdrmer avatar drmingdrmer commented on June 19, 2024

You have initialized the cluster twice with different config, which result in a brain split state.

To incrementally setup a cluster, just call Raft::initialize({0:BasicNode}) on node-0.
Then call Raft::add_learner({1:BasicNode}) on node-0 to add node-1 to the cluster.
Then call Raft::change_membership(...) to make node-1 a voter.

Or setup a cluster in oneshot: call Raft:initialize({0:BasicNode, 1:BasicNode...}) on node-0;

Refer to:
https://docs.rs/openraft/latest/openraft/docs/faq/index.html#how-to-initialize-a-cluster

from openraft.

redixhumayun avatar redixhumayun commented on June 19, 2024

@drmingdrmer First off, thank you for being so responsive :)

Also, I saw your conversation on Discord with diptanuc - that helped quite a bit.

However, my only point of confusion is that if I want to start two nodesindependently of one another - seed_node (node 0) and node 1, how do I start them? The independently is important to me here

I can start node 0 using initialize but then how do I start node 1 in a way that does not cause brain split and allow node 1 to communicate with node 0 to allow itself to be registered as part of the cluster?

All the examples I've seen just use add_learner on the seed node to add a new node assuming that the seed node already knows what nodes it wants to add. But what do I do if I want nodes to be able to start independently of the seed node and then send a message to the seed node to allow themselves to be discovered?

from openraft.

drmingdrmer avatar drmingdrmer commented on June 19, 2024

First of all, IMHO, two independent nodes just means brain split. They are equivalent concept, because these two nodes can propose different logs and there is no consensus between them.

Because they have different data, you can not add node-1 with non-empty data(i.e., node-1 has already proposed logs and applied) to the seed node node-0 without losing node-1's data.

If what you want is to let seed node-0 to discover another empty node to join into the cluster, it is not about Raft.
There should be registry service let node-1 to register itself and so that seed node-0 will discover such candidate nodes.

from openraft.

drmingdrmer avatar drmingdrmer commented on June 19, 2024

Closing this issue.

@redixhumayun
If you have any further question, please feel free to reopen it:)

from openraft.

Related Issues (20)

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.