Add the first part of a multirack join service - #10894
Conversation
|
This is part of #10637 |
11364a4 to
a8e7a6b
Compare
Add a new multirack join service tokio task that runs inside the sled-agent on demand. It's run in the same manner as RSS, shares the same context, and is mutually exclusive with RSS. Two new bootstrap-agent-lockstep APIs were added in order to trigger a multirack join and get its ongoing status. Unlike RSS, a `MultirackJoinRequest` can be resent in the case of a typo, misconfiguration, or runtime error. In many cases this will allow the join process to correct itself without requiring a clean slate of the rack. This is all managed via input and output watch channels and therefore obviates the need for worrying about channel bounds. As this PR started to get large, I have only implemented the first part of the multirack join service which sets up the trust quorum. This was enough to validate the starting of the service, the watch channel plumbing, and the ability to correct mistakes in the `MultirackJoinRequest` that triggers the behavior of the service. In order to test this new API, I used [voxel](oxidecomputer/voxel#13) with a 2 rack configuration of 3 sleds each. On the second, non-RSS sled, I logged into `g3` and ran curl requests against the bootstrap-agent-lockstep server. In order to help this testing, I created a one off tool to generate example JSON output from a hardcoded configuration. I expect this to be useful for the remainder of the implementation and then removed once the implementation is complete. Another large chunk of this code is just integrating with the existing bootstrap agent, wicket, and wicketd functionality. This should remain static for the remainder of the implementation.
a8e7a6b to
ab718d7
Compare
|
Some testing:
|
karencfv
left a comment
There was a problem hiding this comment.
Got curious about this PR and left some passer-by nit comments 😄
| false | ||
| } | ||
| } | ||
| _ => { |
There was a problem hiding this comment.
It'd be nice for this match statement to be exhaustive
There was a problem hiding this comment.
In this case I actually don't want the match to be exhaustive. Exhaustive matches are useful when you want the compilation to fail if a new state gets added, because the behavior of the some code will need to change in that spot. However, in this case, all I want to know is if the code is already in the TrustQuorumPreparing state. If it's not then we know that we need to return true so an update gets sent on the watch channel, or we have to check if the state data changed if we are already in this state to determine whether to return true or false.
Since this code is not complete, and more unrelated states are going to be added, I don't want to have compilation fail and force me to update this code unnecessarily.
There was a problem hiding this comment.
Fair. I haven't tried it, but would something like this work?
self.output_tx.send_if_modified(|state| {
let new_state = MultirackJoinServiceState::TrustQuorumPreparing(status);
if *state == new_state {
false
} else {
*state = new_state;
true
}
});It's a bit easier to read imo
There was a problem hiding this comment.
Ooh. I like this a lot better. Thanks @karencfv !
This builds upon #10894 and adds support for starting sled agents after trust quorum completes. Combined, the two PRs implement 2/3 of the requirements for the first cut of the multirack join service described in #10637. The remaining part is to bring the front ports on line for serving DDM traffic and and announcing the new rack prefix over DDM.
Add a new multirack join service tokio task that runs inside the
sled-agent on demand. It's run in the same manner as RSS, shares
the same context, and is mutually exclusive with RSS.
Two new bootstrap-agent-lockstep APIs were added in order to
trigger a multirack join and get its ongoing status. Unlike
RSS, a
MultirackJoinRequestcan be resent in the case of a typo,misconfiguration, or runtime error. In many cases this will allow the
join process to correct itself without requiring a clean slate of the
rack. This is all managed via input and output watch channels and
therefore obviates the need for worrying about channel bounds.
As this PR started to get large, I have only implemented the first
part of the multirack join service which sets up the trust quorum.
This was enough to validate the starting of the service, the
watch channel plumbing, and the ability to correct mistakes in the
MultirackJoinRequestthat triggers the behavior of the service.In order to test this new API, I used
voxel with a 2 rack
configuration of 3 sleds each. On the second, non-RSS sled, I logged
into
g3and ran curl requests against the bootstrap-agent-lockstepserver. In order to help this testing, I created a one off tool to
generate example JSON output from a hardcoded configuration. I expect
this to be useful for the remainder of the implementation and then
removed once the implementation is complete.
Another large chunk of this code is just integrating with the existing
bootstrap agent and wicketd functionality. This should remain static for
the remainder of the implementation.