refactor: flatten test harness storage compat aliases (#3596)

* refactor: flatten test harness storage compat aliases

* refactor: flatten rustfs storage compat aliases (#3597)

* refactor: prune runtime storage compat surface (#3598)

* refactor: flatten runtime secondary storage compat (#3599)

* docs: add scheduler placement profiling baselines (#3600)

* feat: add observability topology capability contracts (#3601)
This commit is contained in:
安正超
2026-06-19 08:30:47 +08:00
committed by GitHub
parent b1c6578df1
commit ada6f7587e
87 changed files with 1551 additions and 990 deletions
+6 -24
View File
@@ -12,28 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
pub(crate) mod ecstore {
#![allow(unused_imports)]
#![allow(unused_imports)]
pub(crate) mod bucket {
pub(crate) mod metadata_sys {
pub(crate) use rustfs_ecstore::bucket::metadata_sys::init_bucket_metadata_sys;
}
}
pub(crate) mod disk {
pub(crate) use rustfs_ecstore::disk::DiskStore;
pub(crate) mod endpoint {
pub(crate) use rustfs_ecstore::disk::endpoint::Endpoint;
}
}
pub(crate) mod endpoints {
pub(crate) use rustfs_ecstore::endpoints::{EndpointServerPools, Endpoints, PoolEndpoints};
}
pub(crate) mod store {
pub(crate) use rustfs_ecstore::store::{ECStore, init_local_disks};
}
}
pub(crate) use rustfs_ecstore::bucket::metadata_sys::init_bucket_metadata_sys;
pub(crate) use rustfs_ecstore::disk::{DiskStore, endpoint::Endpoint};
pub(crate) use rustfs_ecstore::endpoints::{EndpointServerPools, Endpoints, PoolEndpoints};
pub(crate) use rustfs_ecstore::store::ECStore;
pub(crate) use rustfs_ecstore::store::init_local_disks;
+3 -6
View File
@@ -16,8 +16,7 @@
mod common;
use crate::common::storage_compat::ecstore::disk::endpoint::Endpoint;
use crate::common::storage_compat::ecstore::endpoints::{EndpointServerPools, Endpoints, PoolEndpoints};
use crate::common::storage_compat::{ECStore, Endpoint, EndpointServerPools, Endpoints, PoolEndpoints, init_local_disks};
use std::net::SocketAddr;
use tempfile::TempDir;
use tokio_util::sync::CancellationToken;
@@ -73,12 +72,10 @@ async fn test_endpoint_index_settings() -> anyhow::Result<()> {
}
// test ECStore initialization
crate::common::storage_compat::ecstore::store::init_local_disks(endpoint_pools.clone()).await?;
init_local_disks(endpoint_pools.clone()).await?;
let server_addr: SocketAddr = "127.0.0.1:0".parse().unwrap();
let ecstore =
crate::common::storage_compat::ecstore::store::ECStore::new(server_addr, endpoint_pools, CancellationToken::new())
.await?;
let ecstore = ECStore::new(server_addr, endpoint_pools, CancellationToken::new()).await?;
println!("ECStore initialized successfully with {} pools", ecstore.pools.len());
+8 -23
View File
@@ -22,7 +22,7 @@ use rustfs_heal::heal::{
#[test]
fn test_heal_event_to_heal_request_no_panic() {
use crate::common::storage_compat::ecstore::disk::endpoint::Endpoint;
use crate::common::storage_compat::Endpoint;
// Test that invalid pool/set indices don't cause panic
// Create endpoint using try_from or similar method
@@ -47,7 +47,7 @@ fn test_heal_event_to_heal_request_no_panic() {
#[test]
fn test_heal_event_to_heal_request_valid_indices() {
use crate::common::storage_compat::ecstore::disk::endpoint::Endpoint;
use crate::common::storage_compat::Endpoint;
// Test that valid indices work correctly
let endpoint_result = Endpoint::try_from("http://localhost:9000");
@@ -192,14 +192,11 @@ fn test_heal_task_status_atomic_update() {
}
async fn get_disk_status(
&self,
_endpoint: &crate::common::storage_compat::ecstore::disk::endpoint::Endpoint,
_endpoint: &crate::common::storage_compat::Endpoint,
) -> rustfs_heal::Result<rustfs_heal::heal::storage::DiskStatus> {
Ok(rustfs_heal::heal::storage::DiskStatus::Ok)
}
async fn format_disk(
&self,
_endpoint: &crate::common::storage_compat::ecstore::disk::endpoint::Endpoint,
) -> rustfs_heal::Result<()> {
async fn format_disk(&self, _endpoint: &crate::common::storage_compat::Endpoint) -> rustfs_heal::Result<()> {
Ok(())
}
async fn get_bucket_info(&self, _bucket: &str) -> rustfs_heal::Result<Option<rustfs_storage_api::BucketInfo>> {
@@ -253,10 +250,7 @@ fn test_heal_task_status_atomic_update() {
) -> rustfs_heal::Result<(Vec<String>, Option<String>, bool)> {
Ok((vec![], None, false))
}
async fn get_disk_for_resume(
&self,
_set_disk_id: &str,
) -> rustfs_heal::Result<crate::common::storage_compat::ecstore::disk::DiskStore> {
async fn get_disk_for_resume(&self, _set_disk_id: &str) -> rustfs_heal::Result<crate::common::storage_compat::DiskStore> {
Err(rustfs_heal::Error::other("Not implemented in mock"))
}
}
@@ -326,17 +320,11 @@ async fn test_heal_task_transient_object_exists_skip_avoids_recreate() {
Ok(Vec::new())
}
async fn get_disk_status(
&self,
_endpoint: &crate::common::storage_compat::ecstore::disk::endpoint::Endpoint,
) -> rustfs_heal::Result<DiskStatus> {
async fn get_disk_status(&self, _endpoint: &crate::common::storage_compat::Endpoint) -> rustfs_heal::Result<DiskStatus> {
Ok(DiskStatus::Ok)
}
async fn format_disk(
&self,
_endpoint: &crate::common::storage_compat::ecstore::disk::endpoint::Endpoint,
) -> rustfs_heal::Result<()> {
async fn format_disk(&self, _endpoint: &crate::common::storage_compat::Endpoint) -> rustfs_heal::Result<()> {
Ok(())
}
@@ -406,10 +394,7 @@ async fn test_heal_task_transient_object_exists_skip_avoids_recreate() {
Ok((Vec::new(), None, false))
}
async fn get_disk_for_resume(
&self,
_set_disk_id: &str,
) -> rustfs_heal::Result<crate::common::storage_compat::ecstore::disk::DiskStore> {
async fn get_disk_for_resume(&self, _set_disk_id: &str) -> rustfs_heal::Result<crate::common::storage_compat::DiskStore> {
Err(rustfs_heal::Error::other("not implemented"))
}
}
+4 -8
View File
@@ -14,10 +14,8 @@
mod common;
use crate::common::storage_compat::ecstore::{
disk::endpoint::Endpoint,
endpoints::{EndpointServerPools, Endpoints, PoolEndpoints},
store::ECStore,
use crate::common::storage_compat::{
ECStore, Endpoint, EndpointServerPools, Endpoints, PoolEndpoints, init_bucket_metadata_sys, init_local_disks,
};
use http::HeaderMap;
use rustfs_common::heal_channel::{HealOpts, HealScanMode};
@@ -124,9 +122,7 @@ async fn setup_test_env() -> (Vec<PathBuf>, Arc<ECStore>, Arc<ECStoreHealStorage
let endpoint_pools = EndpointServerPools(vec![pool_endpoints]);
// format disks (only first time)
crate::common::storage_compat::ecstore::store::init_local_disks(endpoint_pools.clone())
.await
.unwrap();
init_local_disks(endpoint_pools.clone()).await.unwrap();
// create ECStore with dynamic port 0 (let OS assign) or fixed 9001 if free
let port = 9001; // for simplicity
@@ -144,7 +140,7 @@ async fn setup_test_env() -> (Vec<PathBuf>, Arc<ECStore>, Arc<ECStoreHealStorage
.await
.unwrap();
let buckets = buckets_list.into_iter().map(|v| v.name).collect();
crate::common::storage_compat::ecstore::bucket::metadata_sys::init_bucket_metadata_sys(ecstore.clone(), buckets).await;
init_bucket_metadata_sys(ecstore.clone(), buckets).await;
// Create heal storage layer
let heal_storage = Arc::new(ECStoreHealStorage::new(ecstore.clone()));