aboutsummaryrefslogtreecommitdiff
path: root/src/garage/admin.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-09-07 18:13:27 +0200
committerAlex Auvolat <alex@adnab.me>2022-09-07 18:13:27 +0200
commit8adc6547132412ef7a43ea4172b2d627c19c38a7 (patch)
treeb026cc5a398b17120f21d4e490901032da573531 /src/garage/admin.rs
parent107853334bd045e145e3149c63172a9c0260b8db (diff)
parent9f5433db821612fc462800c7532418522d6dbe2a (diff)
downloadgarage-8adc6547132412ef7a43ea4172b2d627c19c38a7.tar.gz
garage-8adc6547132412ef7a43ea4172b2d627c19c38a7.zip
Merge branch 'main' into improve-deps
Diffstat (limited to 'src/garage/admin.rs')
-rw-r--r--src/garage/admin.rs32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/garage/admin.rs b/src/garage/admin.rs
index 8854a58d..9c4ecd9d 100644
--- a/src/garage/admin.rs
+++ b/src/garage/admin.rs
@@ -15,6 +15,8 @@ use garage_table::*;
use garage_rpc::*;
+use garage_block::repair::ScrubWorkerCommand;
+
use garage_model::bucket_alias_table::*;
use garage_model::bucket_table::*;
use garage_model::garage::Garage;
@@ -782,13 +784,13 @@ impl AdminRpcHandler {
writeln!(
&mut ret,
" resync queue length: {}",
- self.garage.block_manager.resync_queue_len()?
+ self.garage.block_manager.resync.queue_len()?
)
.unwrap();
writeln!(
&mut ret,
" blocks with resync errors: {}",
- self.garage.block_manager.resync_errors_len()?
+ self.garage.block_manager.resync.errors_len()?
)
.unwrap();
@@ -839,6 +841,32 @@ impl AdminRpcHandler {
let workers = self.garage.background.get_worker_info();
Ok(AdminRpc::WorkerList(workers, opt))
}
+ WorkerCmd::Set { opt } => match opt {
+ WorkerSetCmd::ScrubTranquility { tranquility } => {
+ let scrub_command = ScrubWorkerCommand::SetTranquility(tranquility);
+ self.garage
+ .block_manager
+ .send_scrub_command(scrub_command)
+ .await;
+ Ok(AdminRpc::Ok("Scrub tranquility updated".into()))
+ }
+ WorkerSetCmd::ResyncNWorkers { n_workers } => {
+ self.garage
+ .block_manager
+ .resync
+ .set_n_workers(n_workers)
+ .await?;
+ Ok(AdminRpc::Ok("Number of resync workers updated".into()))
+ }
+ WorkerSetCmd::ResyncTranquility { tranquility } => {
+ self.garage
+ .block_manager
+ .resync
+ .set_tranquility(tranquility)
+ .await?;
+ Ok(AdminRpc::Ok("Resync tranquility updated".into()))
+ }
+ },
}
}
}