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

Ensures datasets get propagated into RSS blueprint #7000

Merged
merged 15 commits into from
Nov 12, 2024
Merged

Ensures datasets get propagated into RSS blueprint #7000

merged 15 commits into from
Nov 12, 2024

Conversation

smklein
Copy link
Collaborator

@smklein smklein commented Nov 5, 2024

  • Ensures that RSS actually tracks datasets and adds them to the initial blueprint
  • Ensures that RSS adds all datasets to CockroachDB, including the Debug dataset, Zone filesystems, etc
  • Ensures that RSS sets the datasets during initialization

Fixes #6989

@@ -3128,6 +3128,7 @@
"type": "object",
"properties": {
"address": {
"nullable": true,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before this PR: The public-facing API to "add a dataset to the DB" required a SocketAddr type.

This is an artifact which was partially fixed by #2000 - unfortunately, there is code which still uses these IP/port pairs if they exist, but they are not required to exist for a dataset record to be created.

Anyway - TL;DR, they're optional, as they should be.

impl SledConfig {
/// Adds a zone to the Sled's configuration, as well as any number of
/// durable datasets.
pub fn add_zone_and_datasets(&mut self, zone: BlueprintZoneConfig) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is RSS's version of "whenever you add a zone, make sure you track all possible datasets used by that zone too".

@@ -119,6 +124,54 @@ pub struct SledConfig {
pub zones: Vec<BlueprintZoneConfig>,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Struggling to comment the right line here -- I'm trying to comment on the pub datasets: DatasetsConfig line above -- but basically:

That's what this PR is most significantly trying to fix

.await
.await?;

// Ensure all datasets are initialized
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the equivalent of the "blueprint executor", as controlled by RSS. "Request datasets before requesting zones".

@smklein smklein marked this pull request as ready for review November 6, 2024 01:31
.pool_name
.id()
.into_untyped_uuid(),
dataset_id: zone.id.into_untyped_uuid(),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was nasty - we re-used the zone UUID as a dataset UUID 😬

We aren't doing that anymore - datasets have their own Uuids that are provisioned as they are created within the plan.

@smklein smklein requested a review from andrewjstone November 6, 2024 01:52
Copy link
Contributor

@andrewjstone andrewjstone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. Just one bit of confusion from me.

@@ -107,6 +107,7 @@ impl DatasetName {
&self.pool_name
}

// TODO: Maybe rename this to "kind"?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I figure this will have ripple effects which is why you didn't do it in this PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's a mechanical change, so I figured I'd punt it out when I get to a less conflict-y place

>(());
};

if let sled_agent_client::Error::ErrorResponse(response) = &error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm failing to see how this could happen during an initial rack setup. We won't handoff to nexus until after RSS, which we won't do until we finish calling this method. The only way this can fail in this scenario is if we call RSS again after the rack is already initialized. That is gated elsewhere though and we shouldn't even get here right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this may have been a result of copying "how we initialize zones" to "disks" and now to "datasets".

I've removed this in 6f6a87c - any conflict is now a hard error, for both disk and dataset initialization.

@smklein
Copy link
Collaborator Author

smklein commented Nov 6, 2024

Tested this in a4x2, saw the following:

  1. The root blueprint has all datasets
  2. The blueprint diff shows no change in zones. I can try to merge [nexus] Expand BlueprintDiff to identify changed datasets #6481 and confirm there are no changes in the datasets as well.

@smklein
Copy link
Collaborator Author

smklein commented Nov 8, 2024

Okay, took this for a spin again on a4x2. Turns out, investing in the blueprint diff logic in #6481 was worthwhile.

Here's what I did:

  • Spun up Nexus
  • Observed a blueprint from RSS (bp1)
  • Ran omdb nexus blueprints regenerate to make bp2
  • Ran omdb nexus blueprints diff bp1 bp1

The results? They're almost the same, but turns out they have differing opinions on the compression level:

*   oxp_3a4d0477-79cc-417e-a2b4-ee1cd472e899/crypt/debug                                                           82fb3783-d55a-4335-8f14-09288f0081f3   100 GiB   none          - gzip-9   
     └─                                                                                                                                                                           + off      
*   oxp_59a3fa5a-e598-43a1-a67c-4b7149faf65b/crypt/debug                                                           0c038f13-e88e-485c-89ae-037df52b5fa0   100 GiB   none          - gzip-9   
     └─                                                                                                                                                                           + off      
*   oxp_83972e7f-2bfc-432b-9414-f2d0b0604713/crypt/debug                                                           53559bae-12ec-491c-9380-17cad82bf2a6   100 GiB   none          - gzip-9   
     └─                                                                                                                                                                           + off      
*   oxp_849647bf-82ee-452a-86b6-a5a230b6c897/crypt/debug                                                           87d4d31a-1eed-447e-a2fc-9ffeeef91a73   100 GiB   none          - gzip-9   
     └─                                                                                                                                                                           + off      
*   oxp_ffe80101-a099-477b-b06e-7e26f3d92ed1/crypt/debug                                                           21e4641e-8665-40af-ac98-5d55e44ef7b4   100 GiB   none          - gzip-9   
     └─                                                                                                                                                                           + off   

Seems that's because the Sled Agent initializes this dataset with Gzip-9:

// For storing full kernel RAM dumps
ExpectedDataset::new(DUMP_DATASET)
.quota(DUMP_DATASET_QUOTA)
.compression(DUMP_DATASET_COMPRESSION),

But the reconfigurator is hard-coded to use CompressionAlgorithm::Off:

In 084d6f8 , I went ahead and updated this to be "gzip-9" everywhere.

End result: This RSS-generated blueprint should now be identical to one immediately generated by Nexus.

@smklein smklein merged commit e8e5dd9 into main Nov 12, 2024
17 checks passed
@smklein smklein deleted the rss-datasets branch November 12, 2024 18:23
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.

datasets not getting propagated into initial blueprint from RSS
2 participants