diff options
author | Alex <alex@adnab.me> | 2022-09-05 12:35:08 +0200 |
---|---|---|
committer | Alex <alex@adnab.me> | 2022-09-05 12:35:08 +0200 |
commit | 0009fd136c744944888df15d706ca08ca251aed7 (patch) | |
tree | c77f5299ac72bcb69c3832022fd3c05140489f7a /src/garage/cli | |
parent | 532eca7ff94e4710283fb38951a349a83654de59 (diff) | |
parent | e1751c8a9cb2a0d91b5aed636ee72ca4fa31ca68 (diff) | |
download | garage-0009fd136c744944888df15d706ca08ca251aed7.tar.gz garage-0009fd136c744944888df15d706ca08ca251aed7.zip |
Merge pull request 'Make block resync speed dynamically configurable' (#369) from resync-ajustable-speed into main
Included in this PR:
- [x] Small refactor, resync code is moved to a separate `block/resync.rs` file
- [x] Block resync tranquility is no longer in config file, it is set dynamically using `garage worker set resync-tranquility` (this parameter is persisted over Garage restarts)
- [x] Up to 4 block resync workers can be activated to run simultaneously to speed up big resyncs, this parameter is set dynamically using `garage worker set resync-n-workers`
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/369
Diffstat (limited to 'src/garage/cli')
-rw-r--r-- | src/garage/cli/structs.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/garage/cli/structs.rs b/src/garage/cli/structs.rs index 9274f80f..0388cef5 100644 --- a/src/garage/cli/structs.rs +++ b/src/garage/cli/structs.rs @@ -501,6 +501,12 @@ pub enum WorkerCmd { #[structopt(flatten)] opt: WorkerListOpt, }, + /// Set worker parameter + #[structopt(name = "set", version = version::garage())] + Set { + #[structopt(subcommand)] + opt: WorkerSetCmd, + }, } #[derive(Serialize, Deserialize, StructOpt, Debug, Eq, PartialEq, Clone, Copy)] @@ -512,3 +518,16 @@ pub struct WorkerListOpt { #[structopt(short = "e", long = "errors")] pub errors: bool, } + +#[derive(Serialize, Deserialize, StructOpt, Debug, Eq, PartialEq, Clone)] +pub enum WorkerSetCmd { + /// Set tranquility of scrub operations + #[structopt(name = "scrub-tranquility", version = version::garage())] + ScrubTranquility { tranquility: u32 }, + /// Set number of concurrent block resync workers + #[structopt(name = "resync-n-workers", version = version::garage())] + ResyncNWorkers { n_workers: usize }, + /// Set tranquility of block resync operations + #[structopt(name = "resync-tranquility", version = version::garage())] + ResyncTranquility { tranquility: u32 }, +} |