-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sled-agent] Refactor service management out of
StorageManager
(#2946)
## History The Sled Agent has historically had two different "managers" responsible for Zones: 1. `ServiceManager`, which resided over zones that do not operate on Datasets 2. `StorageManager`, which manages disks, but also manages zones which operate on those disks This separation is even reflected in the sled agent API exposed to Nexus - the Sled Agent exposes: - `PUT /services` - `PUT /filesystem` For "add a service (within a zone) to this sled" vs "add a dataset (and corresponding zone) to this sled within a particular zpool". This has been kinda handy for Nexus, since "provision CRDB on this dataset" and "start the CRDB service on that dataset" don't need to be separate operations. Within the Sled Agent, however, it has been a pain-in-the-butt from a perspective of diverging implementations. The `StorageManager` and `ServiceManager` have evolved their own mechanisms for storing configs, identifying filesystems on which to place zpools, etc, even though their responsibilities (managing running zones) overlap quite a lot. ## This PR This PR migrates the responsibility for "service management" entirely into the `ServiceManager`, leaving the `StorageManager` responsible for monitoring disks. In detail, this means: - The responsibility for launching Clickhouse, CRDB, and Crucible zones has moved from `storage_manager.rs` into `services.rs` - Unfortunately, this also means we're taking a somewhat hacky approach to formatting CRDB. This is fixed in #2954. - The `StorageManager` no longer requires an Etherstub device during construction - The `ServiceZoneRequest` can operate on an optional `dataset` argument - The "config management" for datastore-based zones is now much more aligned with non-dataset zones. Each sled stores `/var/oxide/services.toml` and `/var/oxide/storage-services.toml` for each group. - These still need to be fixed with #2888 , but it should be simpler now. - `filesystem_ensure` - which previously asked the `StorageManager` to format a dataset and also launch a zone - now asks the `StorageManager` to format a dataset, and separately asks the `ServiceManager` to launch a zone. - In the future, this may become vectorized ("ensure the sled has *all* the datasets we want...") to have parity with the service management, but this would require a more invasive change in Nexus.
- Loading branch information
Showing
13 changed files
with
777 additions
and
758 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.