Skip to content

Conversation

@jgallagher
Copy link
Contributor

This builds on top of #9370 and is a big piece of #9238: as of this PR, BlueprintBuilder no longer holds a PlanningInput, which should reduce confusion on where a given bit of logic should live. Anything that needs the planning input to be decided now must be implemented in the planner.

BlueprintBuilder::new_based_on(..) still takes a PlanningInput argument, which I don't love but need to do some more work to figure out how (if?) to address. It uses it for a few things; I think I'd group them as:

  1. Reassembling information about sleds that we knew in previous iterations but that aren't stored in the blueprint. (Specifically: the BaseboardId and subnet of each active sleds. This is the one that seems trickiest to tackle.)
  2. Adding new, empty SledEditors for commissioned sleds that are present in PlanningInput but not the parent blueprint. (I think I'd make the case that new_based_on() shouldn't do this at all, and the planner should do it?)
  3. Making a copy of a few fields that are present in the blueprint, but that are updated each time the planner runs based on potentially-newer values in PlanningInput. (Specifically: the cockroachdb fingerprint and the internal/external DNS generations. I think it would be fine for BlueprintBuilder to only copy the parent blueprint, and provide setters that the planner could use to update these to newer values.)

There's one hopefully-small-and-fine logical change in this PR that I'll point out below with some extra details.

@jgallagher jgallagher changed the base branch from main to john/planner-configures-clickhouse November 7, 2025 21:16

// We'll check both the disks available to this sled per our current
// blueprint and the list of all in-service zpools on this sled per our
// planning input, and only pick zpools that are available in both.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the logical change I mentioned in the PR description: I removed this second check that we only pick a zpool that's also InService according to the planning input.

I believe this change should not affect any planner behavior. It always decommissions disks before potentially adding new zones, so any disks that are no longer in service in the planning input will also no longer be in service according to the BlueprintPhysicalDiskDisposition by the time we get here.

This change could affect some weirder tests that only go through BlueprintBuilder, but I'm hoping we don't have any that trip over that particular case. If we do I think I'd claim the test is probably in the wrong: it means they'd be decommissioning disks, not updating the disk config to match, then trying to add zones that require a trip through this method to pick an available disk.

@jgallagher jgallagher force-pushed the john/builder-dont-keep-planning-input branch from f2abab5 to ce13a32 Compare November 10, 2025 19:51
Base automatically changed from john/planner-configures-clickhouse to main November 10, 2025 23:01
@jgallagher jgallagher force-pushed the john/builder-dont-keep-planning-input branch from ce13a32 to 430665d Compare November 10, 2025 23:03
Copy link
Contributor

@sunshowers sunshowers left a comment

Choose a reason for hiding this comment

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

This seems great to me, thanks for taking care of it. The logical change seems pretty reasonable to me.

Comment on lines -515 to -517
// These fields are used to allocate resources for sleds.
input: &'a PlanningInput,

Copy link
Contributor

Choose a reason for hiding this comment

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

How do we ensure the PlanningInput doesn't creep its way in here in the future?

Copy link
Contributor Author

@jgallagher jgallagher Nov 11, 2025

Choose a reason for hiding this comment

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

I don't think there's any way to guarantee it, but: I'm working on a few more PRs to remove the need to pass it into BlueprintBuilder::new_based_on() at all. Hopefully at that point the bar for adding it back is pretty high.

@jgallagher jgallagher merged commit 98b55de into main Nov 12, 2025
16 checks passed
@jgallagher jgallagher deleted the john/builder-dont-keep-planning-input branch November 12, 2025 16:32
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.

3 participants