GithubHelp home page GithubHelp logo

Comments (6)

greensky00 avatar greensky00 commented on July 3, 2024

Hi @xuluna, you can add only one server at a time. Return code -7 means previous adding server operation is still in progress. Are you seeing this result in basic examples?

Also please make sure that when you add a server, that server should be online.

from nuraft.

xuluna avatar xuluna commented on July 3, 2024

@greensky00 Thank you so much for quick response! Yes I can guarantee the servers are all online. Then, in this case, how can I know when the previous request is done and I can add another server?

from nuraft.

greensky00 avatar greensky00 commented on July 3, 2024

@xuluna Since adding server is an asynchronous operation (as it will do data sync or snapshot transmission, may take long time), you need to do polling using below API:

ptr<srv_config> get_srv_config(int32 srv_id) const;

If adding server is not done yet, it will return nullptr.

A naive example of waiting for adding server is done, in Benchmark tool:

// Wait until it appears in server list.

from nuraft.

xuluna avatar xuluna commented on July 3, 2024

@greensky00 Thanks! Sorry but I encountered another error:asio_service.cxx:operator():305: session 1 failed to read rpc header from socket 9.1.75.37:59884 due to error 2. This message is from a follower, there's no error message from the leader. I don't know why the port number is 59884. The leader's info is like this:
peer 1, DC ID 0, 9.1.75.37:9999, voting member, 1
peer 2, DC ID 0, 9.1.75.3:9999, voting member, 1
my id: 1, leader: 1, term: 1
Both ports should be 9999.

This error message also happens in examples (echo_server).

from nuraft.

greensky00 avatar greensky00 commented on July 3, 2024

Hi @xuluna,
If you meant below message in follower,

session 1 failed to read rpc header from socket 127.0.0.1:48174 due to error 2  [asio_service.cxx:305, operator()()]

please note that is normal and you can treat it as one-time false alarm. Whenever the sync-up with newly joining server is done, the leader closes previous channel (used for data sync) and then opens a new channel (for normal Raft protocol).

From follower's point of view, that error message shows up when the current connection is closed by leader.

If that message disrupts you, maybe we can provide a patch for workaround. Thanks.

from nuraft.

xuluna avatar xuluna commented on July 3, 2024

@greensky00 Thank you for your patient explanation! I'm fine with that message.

from nuraft.

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.