Add rebalance tool with --dry-run support

Pure plan_rebalance() computes diffs between current and desired placement.
Execution copies blobs to new volumes, updates index, deletes from old.
Skips keys where copy fails. Includes unit tests for planning logic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Silas Brack 2026-03-07 10:40:36 +01:00
parent ef6f025c3a
commit 2fad27efc6
3 changed files with 208 additions and 3 deletions

View file

@ -47,9 +47,8 @@ async fn main() {
Commands::Rebuild => {
mkv::rebuild::run(&config).await;
}
Commands::Rebalance { dry_run: _ } => {
eprintln!("rebalance not yet implemented");
std::process::exit(1);
Commands::Rebalance { dry_run } => {
mkv::rebalance::run(&config, dry_run).await;
}
}
}