fix(manager): restart nodes with the same safenode port #1302
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR tries to set the
safenode port
to the same value when we runupgrade
.When we initially start a service based network, the
--port
field of thesafenode
is used when we manually add one node at a time. But when using thedeployer
, we do not do that, but instead set thenode_count
. This would mean thatport
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:
node's listen addr
.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 theservice 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 theNodeRegistry
to add in extra fields likebootstrap_peers
,local
etc., for us to provide the--peers
and--local
args in this overwritten service definition file.