-
Notifications
You must be signed in to change notification settings - Fork 45
[sled-agent] Destroy orphaned datasets (PR 3/2) #8323
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
base: main
Are you sure you want to change the base?
Conversation
f3ac7a8
to
fce9033
Compare
/// control "chicken switches" (potentially-destructive sled-agent behavior | ||
/// that can be toggled on or off via `omdb`) | ||
#[clap(subcommand)] | ||
ChickenSwitch(ChickenSwitchCommands), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐔
List, | ||
enum ChickenSwitchCommands { | ||
/// interact with the "destroy orphaned datasets" chicken switch | ||
DestroyOrphans(DestroyOrphansArgs), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't get over the name of this variant.
@@ -65,6 +66,7 @@ pub(crate) fn spawn<T: SledAgentFacilities>( | |||
currently_managed_zpools_tx: watch::Sender<Arc<CurrentlyManagedZpools>>, | |||
external_disks_tx: watch::Sender<HashSet<Disk>>, | |||
raw_disks_rx: RawDisksReceiver, | |||
destroy_orphans: Arc<AtomicBool>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've said it before. All you need is an AtomicBool
!
.datasets_report_orphans( | ||
datasets.clone(), | ||
currently_managed_zpools, | ||
self.destroy_orphans.load(Ordering::Relaxed), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay, proper usage of ordering!
Tested enabling this on One case that would have failed without this is this internal DNS dataset, which we expunged and replaced on the same zpool:
Looking at the zpool history, we see when RSS created the initial dataset, and when sled-agent destroyed it and replaced it with the new one:
|
Builds on #8302. This allows the config-reconciler to destroy durable datasets it believes are orphaned due to expunged Omicron zones. This is disabled by default, and can be enabled on a sled-by-sled case via a new
omdb sled-agent chicken-switch destroy-orphans enable
subcommand (with related commands toget
anddisable
the same).We don't want to ship automatic dataset deletion before R17 (R16 should only ship "report orphaned datasets"), but we need to be able to turn it on for upgrade testing in the meantime. All of this
chicken-switch
stuff should be removeable after R16, once we're comfortable enabling deletion in general.