heal admin api(3)

Signed-off-by: mujunxiang <1948535941@qq.com>
This commit is contained in:
mujunxiang
2024-11-30 15:27:21 +08:00
parent 6ddfc80943
commit e95bb4c4d7
12 changed files with 571 additions and 1678 deletions
+1 -1
View File
@@ -412,7 +412,7 @@ impl HealRoutine {
None => {
info!("add_worker, tasks_rx was closed, return");
return;
},
}
}
}
}
+4 -4
View File
@@ -40,9 +40,9 @@ use std::{
use tokio::{
select, spawn,
sync::{
watch::{self, Receiver as W_Receiver, Sender as W_Sender},
broadcast::{self, Receiver, Sender},
broadcast,
mpsc::{self, Receiver as M_Receiver, Sender as M_Sender},
watch::{self, Receiver as W_Receiver, Sender as W_Sender},
RwLock,
},
time::{interval, sleep},
@@ -401,7 +401,7 @@ impl HealSequence {
let bucket = h.bucket.clone();
let task1 = Self::heal_disk_meta(h.clone());
let task2 = Self::heal_bucket(h.clone(), &bucket, buckets_only);
let results = join!(task1, task2);
let results = join!(task1, task2);
results.0?;
results.1?;
@@ -756,7 +756,7 @@ impl AllHealState {
let _ = self.mu.write().await;
for (k, v) in self.heal_seq_map.iter() {
if !v.has_ended().await && (has_profix(k, path_s) || has_profix(path_s, k)) {
if (has_profix(k, path_s) || has_profix(path_s, k)) && !v.has_ended().await {
return Err(Error::from_string(format!(
"The provided heal sequence path overlaps with an existing heal path: {}",
k