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

Reconfigurator: Planner should check disks and datasets before decommissioning a sled #7238

Open
jgallagher opened this issue Dec 12, 2024 · 0 comments

Comments

@jgallagher
Copy link
Contributor

#7234 implements an internal validate_decommissionable() method on SledEditor that checks whether a sled the planner wants to decommission has any non-expunged zones. It should also check for non-expunged disks and datasets, but at the moment doing so causes a variety of test failure. We should add something like this:

    fn validate_decommisionable(&self) -> Result<(), SledEditError> {
        // TODO-john The disks and datasets checks below don't pass what the
        // planner does currently to decommission sleds: if a sled is expunged,
        // we'll omit its disks and datasets from the outgoing blueprint
        // entirely without setting them all to the `Expunged` disposition.
        // Fixing this will conflict with ongoing disk work, so for now these
        // checks are commented out.
        /*
        // Check that all disks are expunged...
        if let Some(disk) =
            self.disks(DiskFilter::All).find(|disk| match disk.disposition {
                BlueprintPhysicalDiskDisposition::InService => true,
                BlueprintPhysicalDiskDisposition::Expunged => false,
            })
        {
            return Err(SledEditError::NonDecommissionableDiskInService {
                disk_id: disk.id,
                zpool_id: disk.pool_id,
            });
        }

        // ... and all datasets are expunged ...
        if let Some(dataset) =
            self.datasets(BlueprintDatasetFilter::All).find(|dataset| {
                match dataset.disposition {
                    BlueprintDatasetDisposition::InService => true,
                    BlueprintDatasetDisposition::Expunged => false,
                }
            })
        {
            return Err(SledEditError::NonDecommissionableDatasetInService {
                dataset_id: dataset.id,
                kind: dataset.kind.clone(),
            });
        }
        */

        // ... rest of method to check zones ...
    }
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

No branches or pull requests

1 participant