mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-26 05:56:50 +00:00
chore: converge stale TODOs and apply safe fills (backlog#646) (#4322)
Second TODO-convergence round over the current tree (backlog#646). All line numbers in the old inventory had gone stale after the set_disk / diagnostics / cluster refactors, so this re-scans and reduces the marker count from 144 to 99. STALE removals (comment describes already-implemented behavior, or dead commented-out blocks) across ecstore (set_disk ops/core, store, cluster/rpc, bucket/metadata_sys, services), iam, filemeta, s3select and rustfs auth/object_usecase. No behavior change. Safe fills, each verified: - filemeta: replication_info_equals now also compares replication_state_internal (function currently has no callers; adds a regression test). - bitrot: drop the confirmed-unused `_want` parameter from bitrot_verify and the now-unused `sum` on LocalDisk::bitrot_verify, removing a Bytes::copy_from_slice allocation. Streaming verify uses the file's embedded per-shard hash, never the passed sum. - signer: rename v4_ignored_headers -> V4_IGNORED_HEADERS and drop the non_upper_case_globals allow. - admin/heal: test_decode was #[ignore]d and used serde_urlencoded on a JSON body (would panic); rewire to serde_json::from_slice to match the production decode path, add assertions, un-ignore. Verified: cargo fmt; cargo check on touched crates; tests pass (filemeta, signer, bitrot, heal::test_decode); arch guardrail scripts pass.
This commit is contained in:
@@ -176,7 +176,6 @@ impl Sets {
|
||||
|
||||
let sets = Arc::new(Self {
|
||||
id: fm.id,
|
||||
// sets: todo!(),
|
||||
disk_set,
|
||||
pool_idx,
|
||||
endpoints: endpoints.clone(),
|
||||
@@ -194,10 +193,6 @@ impl Sets {
|
||||
let rx1 = rx.resubscribe();
|
||||
tokio::spawn(async move { asets.monitor_and_connect_endpoints(rx1).await });
|
||||
|
||||
// let sets2 = sets.clone();
|
||||
// let rx2 = rx.resubscribe();
|
||||
// tokio::spawn(async move { sets2.cleanup_deleted_objects_loop(rx2).await });
|
||||
|
||||
Ok(sets)
|
||||
}
|
||||
|
||||
@@ -205,36 +200,6 @@ impl Sets {
|
||||
self.set_drive_count
|
||||
}
|
||||
|
||||
// pub async fn cleanup_deleted_objects_loop(self: Arc<Self>, mut rx: Receiver<()>) {
|
||||
// tokio::time::sleep(Duration::from_secs(5)).await;
|
||||
|
||||
// info!("start cleanup_deleted_objects_loop");
|
||||
|
||||
// // TODO: config interval
|
||||
// let mut interval = tokio::time::interval(Duration::from_secs(15 * 3));
|
||||
// loop {
|
||||
// tokio::select! {
|
||||
// _= interval.tick()=>{
|
||||
|
||||
// info!("cleanup_deleted_objects_loop tick");
|
||||
|
||||
// for set in self.disk_set.iter() {
|
||||
// set.clone().cleanup_deleted_objects().await;
|
||||
// }
|
||||
|
||||
// interval.reset();
|
||||
// },
|
||||
|
||||
// _ = rx.recv() => {
|
||||
// warn!("cleanup_deleted_objects_loop ctx cancelled");
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// warn!("cleanup_deleted_objects_loop exit");
|
||||
// }
|
||||
|
||||
pub async fn monitor_and_connect_endpoints(&self, mut rx: Receiver<()>) {
|
||||
tokio::time::sleep(Duration::from_secs(5)).await;
|
||||
|
||||
@@ -327,17 +292,6 @@ impl Sets {
|
||||
}
|
||||
}
|
||||
|
||||
// async fn commit_rename_data_dir(
|
||||
// &self,
|
||||
// disks: &Vec<Option<DiskStore>>,
|
||||
// bucket: &str,
|
||||
// object: &str,
|
||||
// data_dir: &str,
|
||||
// // write_quorum: usize,
|
||||
// ) -> Vec<Option<Error>> {
|
||||
// unimplemented!()
|
||||
// }
|
||||
|
||||
async fn delete_prefix(&self, bucket: &str, object: &str, opts: &ObjectOptions) -> Result<()> {
|
||||
let mut futures = Vec::new();
|
||||
let mut opt = opts.clone();
|
||||
|
||||
Reference in New Issue
Block a user