revert: rollback AHashMap changes and keep using std HashMap (#6741)

* Revert "perf(ecstore): use AHashMap for FileInfo metadata fields (#6738)"

This reverts commit 13a2ae212e.

* fix(filemeta): restore standard HashMap metadata (#6742)

Remove the direct ahash dependency added for FileInfo metadata and revert the affected filemeta/ecstore call sites back to std::collections::HashMap.

Co-authored-by: heihutu <heihutu@gmail.com>

---------

Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
houseme
2026-08-27 20:46:08 +08:00
committed by GitHub
parent f1de19fc14
commit 152f110583
26 changed files with 87 additions and 141 deletions
@@ -69,7 +69,6 @@ use crate::storage_api_contracts::{
range::HTTPRangeSpec,
};
use crate::store::ECStore;
use ahash::AHashMap;
use async_channel::{Receiver as A_Receiver, Sender as A_Sender, bounded};
use http::HeaderMap;
use rand::RngExt as _;
@@ -2871,7 +2870,7 @@ fn spawn_transition_transaction_recovery_once(api: Arc<ECStore>) {
struct StaleMultipartUploadCandidate {
path: String,
initiated: OffsetDateTime,
metadata: Option<AHashMap<String, String>>,
metadata: Option<HashMap<String, String>>,
}
fn parse_stale_uploads_duration(env_key: &str, default: StdDuration) -> StdDuration {
@@ -2916,9 +2915,9 @@ async fn stale_upload_current_size(set: &Arc<SetDisks>, metadata: &HashMap<Strin
stale_upload_current_size_with_opts(set, metadata, upload_dir, false).await
}
async fn stale_upload_current_size_with_opts<S: std::hash::BuildHasher>(
async fn stale_upload_current_size_with_opts(
set: &Arc<SetDisks>,
metadata: &HashMap<String, String, S>,
metadata: &HashMap<String, String>,
upload_dir: &str,
no_lock: bool,
) -> Option<usize> {
@@ -2951,9 +2950,9 @@ async fn stale_upload_current_size_with_opts<S: std::hash::BuildHasher>(
)
}
async fn stale_upload_lifecycle_due<S: std::hash::BuildHasher>(
async fn stale_upload_lifecycle_due(
set: &Arc<SetDisks>,
metadata: &HashMap<String, String, S>,
metadata: &HashMap<String, String>,
initiated: OffsetDateTime,
upload_dir: &str,
no_lock: bool,
@@ -2979,7 +2978,7 @@ async fn stale_upload_lifecycle_due<S: std::hash::BuildHasher>(
.unwrap_or_default(),
is_latest: true,
delete_marker: false,
user_defined: metadata.iter().map(|(k, v)| (k.clone(), v.clone())).collect(),
user_defined: metadata.clone(),
..Default::default()
};
@@ -11617,7 +11616,7 @@ mod tests {
// Persist the durable backend identity on the transitioned version so the
// recovered free version carries it (matching a registered mock tier);
// free-version remote cleanup fails closed without it.
let mut transitioned_metadata = AHashMap::new();
let mut transitioned_metadata = HashMap::new();
if let Some(identity) = backend_identity {
rustfs_utils::http::metadata_compat::insert_str(
&mut transitioned_metadata,
@@ -12354,7 +12353,7 @@ mod tests {
StaleMultipartUploadCandidate {
path: "sha/upload".to_string(),
initiated: OffsetDateTime::UNIX_EPOCH,
metadata: Some(AHashMap::from([("k".to_string(), "v".to_string())])),
metadata: Some(HashMap::from([("k".to_string(), "v".to_string())])),
},
);