RSS support for deploying multiple instances of a component on a Sled#3446
Merged
davepacheco merged 5 commits intomainfrom Jun 30, 2023
Merged
RSS support for deploying multiple instances of a component on a Sled#3446davepacheco merged 5 commits intomainfrom
davepacheco merged 5 commits intomainfrom
Conversation
87767f2 to
52b42da
Compare
4949ec4 to
5a7ecec
Compare
Collaborator
Author
|
Sorry for the force push. The change is about the same, but it was much easier to rebase this one than resolve a bunch of the merge conflicts. |
02fa09e to
ee88853
Compare
smklein
approved these changes
Jun 29, 2023
Collaborator
smklein
left a comment
There was a problem hiding this comment.
Looks great, thanks for improving this.
I think with your addition of SledInfo, we could make a really minor refactor to make the plan-provisioning testable!
Comment on lines
+243
to
+267
| // Load the information we need about each Sled to be able to allocate | ||
| // components on it. | ||
| let mut sled_info = { | ||
| let result: Result<Vec<SledInfo>, PlanError> = | ||
| futures::future::try_join_all(sleds.values().map( | ||
| |sled_request| async { | ||
| let subnet = sled_request.subnet; | ||
| let sled_address = get_sled_address(subnet); | ||
| let u2_zpools = | ||
| Self::get_u2_zpools_from_sled(log, sled_address) | ||
| .await?; | ||
| let is_scrimlet = | ||
| Self::is_sled_scrimlet(log, sled_address).await?; | ||
| Ok(SledInfo::new( | ||
| sled_request.id, | ||
| subnet, | ||
| sled_address, | ||
| u2_zpools, | ||
| is_scrimlet, | ||
| )) | ||
| }, | ||
| )) | ||
| .await; | ||
| result? | ||
| }; |
Collaborator
There was a problem hiding this comment.
Should we just make this Vec<SledInfo> a required input to this function?
If we do so, I don't think this function tries to contact sled agents directly, and it might be easier to write tests using a "TransientDnsServer"
Collaborator
Author
There was a problem hiding this comment.
Yes, I think that's a great idea.
355bcc0 to
ee88853
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Based on #3390 because that changes a bunch of the same code and I expect it to land sooner than this.
This PR moves us closer to being able to provision multiple CockroachDB zones, even on the same host (e.g., in development and CI) by reworking how RSS assigns components to Sleds to be component-oriented instead of sled-oriented.
I had initially thought I'd do some more work in this PR but I think I want to separate that into follow-on PRs.