-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow adding new nodes on the fly #30
Comments
The was previously some quirks related to this, but now I think it is pretty straightforward. |
New nodes can now be created with n, err := gorums.NewNodeWithID("localhost:9091", 0)
n, err := gorums.NewNode("localhost:9091") And nodes can be added to the manager, which will also establish the connection via: err = mgr.AddNode(n) After this, a new configuration can be created that uses the new nodes. This isn't exactly what was proposed in this issue. I do think the idea to drop passing a list or map of nodes as input to the manager is a good one. We should pass nodes as input to at configuration creation instead. |
This is a major redesign of how we pass node lists and node maps to the system. This now happens only through the creation of a new configuration, but still using the WithNodeList and WithNodeMap options. These can no longer be passed to the manager. The manager still keeps the pool of all nodes in all configurations. A benefit from this change is that the manager can no longer fail with an error. As this is a relatively major change, and there were fair amount of usage examples that had to be updated, this also required a bit of associated clean up. When this rewrite was more or less finished I realized that we could also provide WithNodeIDs, which could have avoided many of the tricky rewrites. I plan to add WithNodeIDs in a follow up commit. Fixes #30.
Is there any reasons that the list of nodes need to be specified up front? As we are always creating a "new configuration", I don't see a problem with adding nodes at runtime to a new configuration.
For starters:
nodeAddrs
argument fromNewManager
.Manager.NewConfiguration
creates connections to non-existent nodes on the fly, adding them to the manager for re-use.The text was updated successfully, but these errors were encountered: