Skip to content

Commit d3f6481

Browse files
committed
Adds background task which automatically removes zone bundles
- Adds a background task to the sled agent, running `zone_bundle::cleanup_task`. That periodically combs through all the zone bundles, and removes "low priority" ones to remain within a percentage of the storage dataset quota. - Adds tools for controlling the priority of a bundle. This currently sorts bundles by their timestamp and cause, where for example explicitly requested bundles have the highest priority. - Adds RPC-like mechanism for asking the cleanup task to report usage information, the number of bytes consumed in the storage directories, for zone bundles. - Adds RPC and sled-agent API for updating the cleanup context, including period of auto cleanups, priority order, and the percentage of the dataset quota allowed. - Adds RPC and sled agent API for making explicit request to trigger a cleanup. - Adds a bunch of tests around the priority ordering and cleanup RPC mechanics Wrap zone bundling into a single type - Adds the `ZoneBundler` for managing the creation and listing of zones, and running background cleanup task. This is created pretty early, by the `StorageManager`, and cloned to the other objects that need access to bundles. - Move public free functions from the `zone_bundle` crate into methods on the `ZoneBundler`, and call them from the instance / service managers and sled agent. - Make the "list-all-zones" endpoint in the sled agent accept a filter directly and propagate to the listing routines inside the bundler. This removes filtering on the client. - Additional tests around listing / filtering. Review feedback - Add more error variants, to better maintain context and the actual error chains. - Remove zone-specific commmands - Remove hand-rolled `PartialOrd` implementation for simplicity, but add comment about the variant order being load-bearing. - Add the handle for the cleanup task to the `ZoneBundler`, and abort it on drop.
1 parent 331f98f commit d3f6481

14 files changed

+2753
-534
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)