Skip to content
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

fix(manager): restart nodes with the same safenode port #1302

Merged
merged 6 commits into from Feb 13, 2024

Conversation

RolandSherwin
Copy link
Member

@RolandSherwin RolandSherwin commented Feb 13, 2024

Description

This PR tries to set the safenode port to the same value when we run upgrade.

When we initially start a service based network, the --port field of the safenode is used when we manually add one node at a time. But when using the deployer, we do not do that, but instead set the node_count. This would mean that port is automatically assigned by the safenode.

Now during the upgrade process, we would want to re-use the same port, else we'd be causing a massive churn. So here is the high level overview on how to achieve this:

  1. Get the node port via the node's listen addr.
  2. Supply this port to the service definition. I.e, add in the --port arg.

The 2nd point would mean that we will be editing the service definition file to add the args. But I could not find any functions inside the service manager crate that would allow me to do that.
Thus, I resorted to overwriting the entire service definition file with all the same args that we used during the initial startup. To acheive this, I had to edit the NodeRegistry to add in extra fields like bootstrap_peers, local etc., for us to provide the --peers and --local args in this overwritten service definition file.

@jacderida jacderida merged commit ebee6c5 into maidsafe:main Feb 13, 2024
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants