mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-28 00:58:59 +00:00
refactor: segment ECStore storage contracts by domain (#3910)
This commit is contained in:
@@ -18,7 +18,7 @@ use crate::rpc::{TonicInterceptor, gen_tonic_signature_interceptor, node_service
|
||||
use crate::{disk::endpoint::Endpoint, runtime_sources};
|
||||
|
||||
use crate::data_usage::load_data_usage_cache;
|
||||
use crate::storage_api_contracts::StorageAdminApi;
|
||||
use crate::storage_api_contracts::admin::StorageAdminApi;
|
||||
use rustfs_common::heal_channel::DriveState;
|
||||
use rustfs_madmin::{
|
||||
BackendDisks, Disk, ErasureSetInfo, ITEM_INITIALIZING, ITEM_OFFLINE, ITEM_ONLINE, InfoMessage, ServerProperties,
|
||||
|
||||
@@ -37,8 +37,11 @@ use crate::object_api::{GetObjectReader, ObjectInfo, ObjectOptions};
|
||||
use crate::runtime_sources;
|
||||
use crate::set_disk::{MAX_PARTS_COUNT, RUSTFS_MULTIPART_BUCKET_KEY, RUSTFS_MULTIPART_OBJECT_KEY, SetDisks};
|
||||
use crate::storage_api_contracts::{
|
||||
DeletedObject, ExpirationOptions, HTTPRangeSpec, ListOperations as _, MultipartOperations as _, ObjectOperations as _,
|
||||
ObjectToDelete,
|
||||
lifecycle::ExpirationOptions,
|
||||
list::ListOperations as _,
|
||||
multipart::MultipartOperations as _,
|
||||
object::{DeletedObject, ObjectOperations as _, ObjectToDelete},
|
||||
range::HTTPRangeSpec,
|
||||
};
|
||||
use crate::store::ECStore;
|
||||
use crate::tier::warm_backend::WarmBackendGetOpts;
|
||||
@@ -387,7 +390,7 @@ pub trait ExpiryOp: 'static {
|
||||
fn as_any(&self) -> &dyn Any;
|
||||
}
|
||||
|
||||
pub use crate::storage_api_contracts::TransitionedObject;
|
||||
pub use crate::storage_api_contracts::lifecycle::TransitionedObject;
|
||||
|
||||
struct FreeVersionTask(ObjectInfo);
|
||||
|
||||
@@ -2891,8 +2894,11 @@ mod tests {
|
||||
use crate::object_api::{ObjectInfo, ObjectOptions, PutObjReader};
|
||||
use crate::runtime_sources;
|
||||
use crate::set_disk::{RUSTFS_MULTIPART_BUCKET_KEY, RUSTFS_MULTIPART_OBJECT_KEY};
|
||||
use crate::storage_api_contracts::ExpirationOptions;
|
||||
use crate::storage_api_contracts::{BucketOperations, BucketOptions, MakeBucketOptions, MultipartOperations as _};
|
||||
use crate::storage_api_contracts::{
|
||||
bucket::{BucketOperations, BucketOptions, MakeBucketOptions},
|
||||
lifecycle::ExpirationOptions,
|
||||
multipart::MultipartOperations as _,
|
||||
};
|
||||
use crate::store::ECStore;
|
||||
use futures::FutureExt;
|
||||
use rustfs_common::metrics::{IlmAction, global_metrics};
|
||||
@@ -4167,7 +4173,7 @@ mod tests {
|
||||
&bucket,
|
||||
object,
|
||||
&upload.upload_id,
|
||||
vec![crate::storage_api_contracts::CompletePart {
|
||||
vec![crate::storage_api_contracts::multipart::CompletePart {
|
||||
part_num: 1,
|
||||
etag: second_part.etag.clone(),
|
||||
checksum_crc32: None,
|
||||
|
||||
@@ -934,7 +934,7 @@ impl Default for Event {
|
||||
}
|
||||
}
|
||||
|
||||
pub use crate::storage_api_contracts::ExpirationOptions;
|
||||
pub use crate::storage_api_contracts::lifecycle::ExpirationOptions;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct TransitionOptions {
|
||||
|
||||
@@ -25,7 +25,9 @@ use crate::disk::RUSTFS_META_BUCKET;
|
||||
use crate::error::{Error, Result};
|
||||
use crate::object_api::{GetObjectReader, ObjectInfo, ObjectOptions, PutObjReader};
|
||||
use crate::storage_api_contracts::{
|
||||
DeletedObject, HTTPRangeSpec, ListOperations as _, ObjectIO, ObjectOperations, ObjectToDelete,
|
||||
list::ListOperations as _,
|
||||
object::{DeletedObject, ObjectIO, ObjectOperations, ObjectToDelete},
|
||||
range::HTTPRangeSpec,
|
||||
};
|
||||
use crate::store::ECStore;
|
||||
use rustfs_filemeta::FileInfo;
|
||||
|
||||
@@ -21,7 +21,8 @@ use crate::disk::RUSTFS_META_BUCKET;
|
||||
use crate::error::Result;
|
||||
use crate::object_api::ObjectInfo;
|
||||
use crate::storage_api_contracts::{
|
||||
BucketOperations, BucketOptions, ListOperations as _, StorageObjectInfoOrErr, StorageWalkOptions,
|
||||
bucket::{BucketOperations, BucketOptions},
|
||||
list::{ListOperations as _, StorageObjectInfoOrErr, StorageWalkOptions},
|
||||
};
|
||||
use crate::store::ECStore;
|
||||
use rustfs_filemeta::FileInfo;
|
||||
|
||||
@@ -23,7 +23,7 @@ use crate::bucket::lifecycle::lifecycle::{self, ObjectOpts};
|
||||
use crate::bucket::lifecycle::tier_delete_journal::persist_tier_delete_journal_entry;
|
||||
use crate::client::signer_error::error_chain_contains_signer_header_marker;
|
||||
use crate::runtime_sources;
|
||||
use crate::storage_api_contracts::TransitionedObject;
|
||||
use crate::storage_api_contracts::lifecycle::TransitionedObject;
|
||||
use crate::store::ECStore;
|
||||
use rustfs_utils::get_env_usize;
|
||||
use sha2::{Digest, Sha256};
|
||||
|
||||
@@ -20,7 +20,7 @@ use crate::bucket::metadata::{BUCKET_LIFECYCLE_CONFIG, load_bucket_metadata_pars
|
||||
use crate::bucket::utils::{deserialize, is_meta_bucketname};
|
||||
use crate::error::{Error, Result, is_err_bucket_not_found};
|
||||
use crate::runtime_sources;
|
||||
use crate::storage_api_contracts::HealOperations as _;
|
||||
use crate::storage_api_contracts::heal::HealOperations as _;
|
||||
use crate::store::ECStore;
|
||||
use futures::future::join_all;
|
||||
use lazy_static::lazy_static;
|
||||
|
||||
@@ -20,10 +20,11 @@ use crate::disk::{BUCKET_META_PREFIX, MIGRATING_META_BUCKET, RUSTFS_META_BUCKET}
|
||||
use crate::error::Error;
|
||||
use crate::object_api::{GetObjectReader, ObjectInfo, ObjectOptions, PutObjReader};
|
||||
use crate::storage_api_contracts::{
|
||||
BucketOperations, BucketOptions, DeletedObject, HTTPRangeSpec, ListOperations, ObjectIO, ObjectOperations, ObjectToDelete,
|
||||
StorageListObjectVersionsInfo, StorageListObjectsV2Info, StorageObjectInfoOrErr, StorageWalkOptions,
|
||||
bucket::{BucketOperations, BucketOptions},
|
||||
list::{ListOperations, StorageListObjectVersionsInfo, StorageListObjectsV2Info, StorageObjectInfoOrErr, StorageWalkOptions},
|
||||
object::{DeletedObject, EcstoreObjectIO, EcstoreObjectOperations, ObjectIO, ObjectOperations, ObjectToDelete},
|
||||
range::HTTPRangeSpec,
|
||||
};
|
||||
use crate::storage_api_contracts::{EcstoreObjectIO, EcstoreObjectOperations};
|
||||
use http::HeaderMap;
|
||||
use rustfs_filemeta::FileInfo;
|
||||
use rustfs_policy::auth::UserIdentity;
|
||||
|
||||
@@ -29,8 +29,8 @@ use crate::disk::BUCKET_META_PREFIX;
|
||||
use crate::error::Error as EcstoreError;
|
||||
use crate::object_api::{ObjectInfo, ObjectOptions};
|
||||
use crate::runtime_sources;
|
||||
use crate::storage_api_contracts::DeletedObject;
|
||||
use crate::storage_api_contracts::EcstoreObjectIO;
|
||||
use crate::storage_api_contracts::object::DeletedObject;
|
||||
use crate::storage_api_contracts::object::EcstoreObjectIO;
|
||||
use lazy_static::lazy_static;
|
||||
use rustfs_filemeta::MrfOpKind;
|
||||
use rustfs_filemeta::MrfReplicateEntry;
|
||||
|
||||
@@ -32,10 +32,11 @@ use crate::object_api::{GetObjectReader, ObjectInfo, ObjectOptions, PutObjReader
|
||||
use crate::runtime_sources;
|
||||
use crate::set_disk::get_lock_acquire_timeout;
|
||||
use crate::storage_api_contracts::{
|
||||
DeletedObject, HTTPRangeSpec, ListOperations, NamespaceLocking as StorageNamespaceLocking, ObjectIO, ObjectOperations,
|
||||
ObjectToDelete, StorageListObjectVersionsInfo, StorageListObjectsV2Info, StorageObjectInfoOrErr, StorageWalkOptions,
|
||||
list::{ListOperations, StorageListObjectVersionsInfo, StorageListObjectsV2Info, StorageObjectInfoOrErr, StorageWalkOptions},
|
||||
namespace::NamespaceLocking as StorageNamespaceLocking,
|
||||
object::{DeletedObject, EcstoreObjectIO, EcstoreObjectOperations, ObjectIO, ObjectOperations, ObjectToDelete},
|
||||
range::HTTPRangeSpec,
|
||||
};
|
||||
use crate::storage_api_contracts::{EcstoreObjectIO, EcstoreObjectOperations};
|
||||
use aws_sdk_s3::error::{ProvideErrorMetadata, SdkError};
|
||||
use aws_sdk_s3::operation::head_object::{HeadObjectError, HeadObjectOutput};
|
||||
use aws_sdk_s3::primitives::ByteStream;
|
||||
|
||||
@@ -26,7 +26,7 @@ use crate::client::{
|
||||
credentials,
|
||||
transition_api::{ReaderImpl, RequestMetadata, TransitionClient},
|
||||
};
|
||||
use crate::storage_api_contracts::BucketInfo;
|
||||
use crate::storage_api_contracts::bucket::BucketInfo;
|
||||
use http::{HeaderMap, StatusCode};
|
||||
use http_body_util::BodyExt;
|
||||
use hyper::body::Body;
|
||||
|
||||
@@ -26,7 +26,7 @@ use tokio::io::BufReader;
|
||||
|
||||
use crate::error::ErrorResponse;
|
||||
use crate::object_api::{GetObjectReader, ObjectInfo, ObjectOptions};
|
||||
use crate::storage_api_contracts::HTTPRangeSpec;
|
||||
use crate::storage_api_contracts::range::HTTPRangeSpec;
|
||||
use rustfs_filemeta::ObjectPartInfo;
|
||||
use rustfs_rio::HashReader;
|
||||
use s3s::S3ErrorCode;
|
||||
|
||||
@@ -25,7 +25,7 @@ use crate::bucket::replication::{DeletedObjectReplicationInfo, check_replicate_d
|
||||
use crate::bucket::versioning::VersioningApi;
|
||||
use crate::bucket::versioning_sys::BucketVersioningSys;
|
||||
use crate::object_api::ObjectOptions;
|
||||
use crate::storage_api_contracts::{ObjectOperations as _, ObjectToDelete};
|
||||
use crate::storage_api_contracts::object::{ObjectOperations as _, ObjectToDelete};
|
||||
use crate::store::ECStore;
|
||||
use rustfs_filemeta::{REPLICATE_INCOMING_DELETE, ReplicationState, version_purge_statuses_map};
|
||||
use rustfs_lock::MAX_DELETE_LIST;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
|
||||
use crate::storage_api_contracts::{
|
||||
use crate::storage_api_contracts::topology::{
|
||||
CapabilityStatus, DiskCapabilities, TopologyCapabilities, TopologyDisk, TopologyLabels, TopologyPool, TopologySet,
|
||||
TopologySnapshot,
|
||||
};
|
||||
|
||||
@@ -17,8 +17,11 @@ use crate::disk::{MIGRATING_META_BUCKET, RUSTFS_META_BUCKET};
|
||||
use crate::error::{Error, Result};
|
||||
use crate::object_api::{GetObjectReader, ObjectInfo, ObjectOptions, PutObjReader};
|
||||
use crate::runtime_sources;
|
||||
use crate::storage_api_contracts::EcstoreObjectIO;
|
||||
use crate::storage_api_contracts::{DeletedObject, HTTPRangeSpec, ObjectIO, ObjectOperations, ObjectToDelete, StorageAdminApi};
|
||||
use crate::storage_api_contracts::{
|
||||
admin::StorageAdminApi,
|
||||
object::{DeletedObject, EcstoreObjectIO, ObjectIO, ObjectOperations, ObjectToDelete},
|
||||
range::HTTPRangeSpec,
|
||||
};
|
||||
use http::HeaderMap;
|
||||
use rustfs_config::audit::{
|
||||
AUDIT_AMQP_KEYS, AUDIT_AMQP_SUB_SYS, AUDIT_KAFKA_KEYS, AUDIT_KAFKA_SUB_SYS, AUDIT_MQTT_KEYS, AUDIT_MQTT_SUB_SYS,
|
||||
@@ -1315,8 +1318,7 @@ mod tests {
|
||||
use crate::object_api::{GetObjectReader, ObjectInfo, ObjectOptions, PutObjReader};
|
||||
use crate::runtime_sources;
|
||||
use crate::set_disk::SetDisks;
|
||||
use crate::storage_api_contracts::NamespaceLocking as _;
|
||||
use crate::storage_api_contracts::{HTTPRangeSpec, StorageAdminApi};
|
||||
use crate::storage_api_contracts::{admin::StorageAdminApi, namespace::NamespaceLocking as _, range::HTTPRangeSpec};
|
||||
use http::HeaderMap;
|
||||
use rustfs_config::audit::{AUDIT_AMQP_SUB_SYS, AUDIT_KAFKA_SUB_SYS, AUDIT_MQTT_SUB_SYS, AUDIT_WEBHOOK_SUB_SYS};
|
||||
use rustfs_config::notify::{
|
||||
@@ -1498,7 +1500,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::ObjectIO for LockingConfigStorage {
|
||||
impl crate::storage_api_contracts::object::ObjectIO for LockingConfigStorage {
|
||||
type Error = Error;
|
||||
type RangeSpec = HTTPRangeSpec;
|
||||
type HeaderMap = HeaderMap;
|
||||
@@ -1549,7 +1551,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::NamespaceLocking for LockingConfigStorage {
|
||||
impl crate::storage_api_contracts::namespace::NamespaceLocking for LockingConfigStorage {
|
||||
type Error = crate::error::Error;
|
||||
type NamespaceLock = rustfs_lock::NamespaceLockWrapper;
|
||||
|
||||
@@ -1579,7 +1581,7 @@ mod tests {
|
||||
|
||||
async fn disk_set_inventory(
|
||||
&self,
|
||||
_selector: crate::storage_api_contracts::DiskSetSelector,
|
||||
_selector: crate::storage_api_contracts::admin::DiskSetSelector,
|
||||
) -> Result<Vec<Option<crate::disk::DiskStore>>> {
|
||||
panic!("unused in test")
|
||||
}
|
||||
|
||||
@@ -15,7 +15,10 @@
|
||||
use crate::error::{Error, Result, is_err_data_movement_overwrite, is_err_object_not_found, is_err_version_not_found};
|
||||
use crate::object_api::{GetObjectReader, ObjectInfo, ObjectOptions, PutObjReader};
|
||||
use crate::set_disk::SetDisks;
|
||||
use crate::storage_api_contracts::{CompletePart, MultipartOperations as _, ObjectIO as _, ObjectOperations as _};
|
||||
use crate::storage_api_contracts::{
|
||||
multipart::{CompletePart, MultipartOperations as _},
|
||||
object::{ObjectIO as _, ObjectOperations as _},
|
||||
};
|
||||
use crate::store::ECStore;
|
||||
use bytes::Bytes;
|
||||
use rustfs_filemeta::{FileInfo, FileInfoVersions, ObjectPartInfo};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
pub mod local_snapshot;
|
||||
|
||||
use crate::storage_api_contracts::{ListOperations as _, ObjectIO as _};
|
||||
use crate::storage_api_contracts::{list::ListOperations as _, object::ObjectIO as _};
|
||||
use crate::{
|
||||
bucket::metadata_sys::get_replication_config,
|
||||
config::com::read_config,
|
||||
@@ -749,7 +749,7 @@ pub fn create_cache_entry_from_summary(summary: &SizeSummary) -> DataUsageEntry
|
||||
pub fn cache_to_data_usage_info(
|
||||
cache: &DataUsageCache,
|
||||
path: &str,
|
||||
buckets: &[crate::storage_api_contracts::BucketInfo],
|
||||
buckets: &[crate::storage_api_contracts::bucket::BucketInfo],
|
||||
) -> DataUsageInfo {
|
||||
let e = match cache.find(path) {
|
||||
Some(e) => e,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
use crate::bucket::error::BucketMetadataError;
|
||||
use crate::disk::error::DiskError;
|
||||
use crate::storage_api_contracts::{HTTPRangeError, StorageErrorCode};
|
||||
use crate::storage_api_contracts::{error::StorageErrorCode, range::HTTPRangeError};
|
||||
use rustfs_utils::path::decode_dir_object;
|
||||
use s3s::{S3Error, S3ErrorCode};
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
use crate::admin_server_info::get_local_server_property;
|
||||
use crate::runtime_sources;
|
||||
use crate::storage_api_contracts::StorageAdminApi;
|
||||
use crate::storage_api_contracts::admin::StorageAdminApi;
|
||||
use chrono::Utc;
|
||||
use rustfs_common::{heal_channel::DriveState, metrics::global_metrics};
|
||||
use rustfs_io_metrics::internode_metrics::global_internode_metrics;
|
||||
|
||||
@@ -19,7 +19,7 @@ use crate::metrics_realtime::{CollectMetricsOpts, MetricType};
|
||||
use crate::rebalance::RebalSaveOpt;
|
||||
use crate::rpc::PeerRestClient;
|
||||
use crate::runtime_sources;
|
||||
use crate::storage_api_contracts::StorageAdminApi;
|
||||
use crate::storage_api_contracts::admin::StorageAdminApi;
|
||||
use futures::future::join_all;
|
||||
use lazy_static::lazy_static;
|
||||
use rustfs_madmin::health::{Cpus, MemInfo, OsInfo, Partitions, ProcInfo, SysConfig, SysErrors, SysServices};
|
||||
|
||||
@@ -17,7 +17,10 @@ use crate::bucket::versioning::VersioningApi as _;
|
||||
use crate::config::storageclass;
|
||||
use crate::error::{Error, Result};
|
||||
use crate::rio::{HashReader, LimitReader};
|
||||
use crate::storage_api_contracts::{ExpirationOptions, HTTPRangeSpec, TransitionedObject};
|
||||
use crate::storage_api_contracts::{
|
||||
lifecycle::{ExpirationOptions, TransitionedObject},
|
||||
range::HTTPRangeSpec,
|
||||
};
|
||||
use crate::store_utils::clean_metadata;
|
||||
use crate::{bucket::lifecycle::bucket_lifecycle_audit::LcAuditEvent, bucket::lifecycle::lifecycle::TransitionOptions};
|
||||
use bytes::Bytes;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
use super::*;
|
||||
use crate::storage_api_contracts::{
|
||||
HTTPPreconditions, ObjectLockRetentionOptions, ObjectPreconditionError, ObjectPreconditionPart, ObjectPreconditionState,
|
||||
VersionMarker,
|
||||
list::VersionMarker,
|
||||
object::{
|
||||
HTTPPreconditions, ObjectLockRetentionOptions, ObjectPreconditionError, ObjectPreconditionPart, ObjectPreconditionState,
|
||||
},
|
||||
};
|
||||
|
||||
#[derive(Debug, Default, Clone)]
|
||||
|
||||
@@ -40,8 +40,11 @@ use crate::rebalance::{REBAL_META_NAME, RebalanceMeta, is_rebalance_conflicting_
|
||||
use crate::runtime_sources;
|
||||
use crate::set_disk::{SetDisks, get_lock_acquire_timeout};
|
||||
use crate::storage_api_contracts::{
|
||||
BucketOperations, BucketOptions, HealOperations as _, MakeBucketOptions, NamespaceLocking as _, ObjectIO as _,
|
||||
ObjectOperations as _, StorageAdminApi,
|
||||
admin::StorageAdminApi,
|
||||
bucket::{BucketOperations, BucketOptions, MakeBucketOptions},
|
||||
heal::HealOperations as _,
|
||||
namespace::NamespaceLocking as _,
|
||||
object::{ObjectIO as _, ObjectOperations as _},
|
||||
};
|
||||
use crate::{sets::Sets, store::ECStore};
|
||||
use byteorder::{ByteOrder, LittleEndian, WriteBytesExt};
|
||||
|
||||
@@ -19,8 +19,9 @@ use super::{
|
||||
use crate::error::{Error, Result};
|
||||
use crate::object_api::ObjectOptions;
|
||||
use crate::set_disk::get_lock_acquire_timeout;
|
||||
use crate::storage_api_contracts::EcstoreObjectIO;
|
||||
use crate::storage_api_contracts::{NamespaceLocking as StorageNamespaceLocking, StorageAdminApi};
|
||||
use crate::storage_api_contracts::{
|
||||
admin::StorageAdminApi, namespace::NamespaceLocking as StorageNamespaceLocking, object::EcstoreObjectIO,
|
||||
};
|
||||
use crate::store::ECStore;
|
||||
use rustfs_filemeta::FileInfo;
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -34,7 +34,7 @@ use crate::error::{Error, Result};
|
||||
use crate::object_api::{GetObjectReader, ObjectOptions};
|
||||
use crate::pools::ListCallback;
|
||||
use crate::set_disk::SetDisks;
|
||||
use crate::storage_api_contracts::ObjectOperations as _;
|
||||
use crate::storage_api_contracts::object::ObjectOperations as _;
|
||||
use crate::store::ECStore;
|
||||
use rustfs_filemeta::MetaCacheEntry;
|
||||
use rustfs_utils::path::encode_dir_object;
|
||||
|
||||
@@ -7,7 +7,7 @@ use super::{
|
||||
};
|
||||
use crate::config::com::{read_config_with_metadata, save_config_with_opts};
|
||||
use crate::error::is_err_operation_canceled;
|
||||
use crate::storage_api_contracts::{HTTPRangeSpec, ObjectIO};
|
||||
use crate::storage_api_contracts::{object::ObjectIO, range::HTTPRangeSpec};
|
||||
use http::HeaderMap;
|
||||
use rustfs_filemeta::FileInfo;
|
||||
use std::{collections::HashSet, fmt, io::Cursor, sync::Arc};
|
||||
|
||||
@@ -3,7 +3,10 @@ use crate::data_usage::DATA_USAGE_CACHE_NAME;
|
||||
use crate::error::{Error, Result, is_err_object_not_found, is_err_version_not_found};
|
||||
use crate::object_api::{GetObjectReader, ObjectInfo, ObjectOptions};
|
||||
use crate::set_disk::SetDisks;
|
||||
use crate::storage_api_contracts::{HTTPRangeSpec, ObjectIO, ObjectOperations as _};
|
||||
use crate::storage_api_contracts::{
|
||||
object::{ObjectIO, ObjectOperations as _},
|
||||
range::HTTPRangeSpec,
|
||||
};
|
||||
use http::HeaderMap;
|
||||
use rustfs_filemeta::FileInfo;
|
||||
use rustfs_utils::path::encode_dir_object;
|
||||
|
||||
@@ -54,7 +54,7 @@ use crate::data_usage::DATA_USAGE_CACHE_NAME;
|
||||
use crate::disk::RUSTFS_META_BUCKET;
|
||||
use crate::disk::error::DiskError;
|
||||
use crate::error::{Error, Result};
|
||||
use crate::storage_api_contracts::HTTPRangeSpec;
|
||||
use crate::storage_api_contracts::range::HTTPRangeSpec;
|
||||
use rustfs_filemeta::FileInfo;
|
||||
use rustfs_filemeta::TRANSITION_COMPLETE;
|
||||
use rustfs_rio::Index;
|
||||
|
||||
@@ -21,7 +21,7 @@ use crate::rpc::client::{
|
||||
TonicInterceptor, gen_tonic_signature_interceptor, is_network_like_disk_error, node_service_time_out_client,
|
||||
};
|
||||
use crate::runtime_sources;
|
||||
use crate::storage_api_contracts::{BucketInfo, BucketOptions, DeleteBucketOptions, MakeBucketOptions};
|
||||
use crate::storage_api_contracts::bucket::{BucketInfo, BucketOptions, DeleteBucketOptions, MakeBucketOptions};
|
||||
use crate::store::all_local_disk;
|
||||
use crate::store_utils::is_reserved_or_invalid_bucket;
|
||||
use crate::{
|
||||
|
||||
@@ -43,13 +43,15 @@ use crate::object_api::ObjectOptions;
|
||||
use crate::rpc::heal_bucket_local_on_disks;
|
||||
use crate::runtime_sources;
|
||||
use crate::storage_api_contracts::{
|
||||
BucketInfo, BucketOperations, BucketOptions, CompletePart, DeleteBucketOptions, DeletedObject, ListMultipartsInfo,
|
||||
ListPartsInfo, MakeBucketOptions, MultipartInfo, MultipartUploadResult, ObjectToDelete, PartInfo,
|
||||
bucket::{BucketInfo, BucketOperations, BucketOptions, DeleteBucketOptions, MakeBucketOptions},
|
||||
list::{StorageListObjectVersionsInfo, StorageListObjectsV2Info, StorageObjectInfoOrErr, StorageWalkOptions},
|
||||
multipart::{
|
||||
CompletePart, ListMultipartsInfo, ListPartsInfo, MultipartInfo, MultipartOperations as _, MultipartUploadResult, PartInfo,
|
||||
},
|
||||
namespace::NamespaceLocking as _,
|
||||
object::{DeletedObject, ObjectIO as _, ObjectOperations as _, ObjectToDelete},
|
||||
range::HTTPRangeSpec,
|
||||
};
|
||||
use crate::storage_api_contracts::{
|
||||
HTTPRangeSpec, StorageListObjectVersionsInfo, StorageListObjectsV2Info, StorageObjectInfoOrErr, StorageWalkOptions,
|
||||
};
|
||||
use crate::storage_api_contracts::{MultipartOperations as _, NamespaceLocking as _, ObjectIO as _, ObjectOperations as _};
|
||||
use crate::store_utils::is_reserved_or_invalid_bucket;
|
||||
use crate::{
|
||||
bucket::lifecycle::bucket_lifecycle_ops::{
|
||||
@@ -1025,7 +1027,7 @@ fn classify_multipart_part_write_path(object_size: i64, block_size: usize) -> Sm
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::ObjectIO for SetDisks {
|
||||
impl crate::storage_api_contracts::object::ObjectIO for SetDisks {
|
||||
type Error = Error;
|
||||
type RangeSpec = HTTPRangeSpec;
|
||||
type HeaderMap = HeaderMap;
|
||||
@@ -2013,7 +2015,7 @@ impl SetDisks {
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::NamespaceLocking for SetDisks {
|
||||
impl crate::storage_api_contracts::namespace::NamespaceLocking for SetDisks {
|
||||
type Error = Error;
|
||||
type NamespaceLock = NamespaceLockWrapper;
|
||||
|
||||
@@ -2269,7 +2271,7 @@ fn check_object_lock_retention_update(bucket: &str, object: &str, obj_info: &Obj
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::ObjectOperations for SetDisks {
|
||||
impl crate::storage_api_contracts::object::ObjectOperations for SetDisks {
|
||||
type Error = Error;
|
||||
type ObjectInfo = ObjectInfo;
|
||||
type ObjectOptions = ObjectOptions;
|
||||
@@ -3375,7 +3377,7 @@ impl crate::storage_api_contracts::ObjectOperations for SetDisks {
|
||||
|
||||
#[tracing::instrument(skip(self))]
|
||||
async fn verify_object_integrity(&self, bucket: &str, object: &str, opts: &ObjectOptions) -> Result<()> {
|
||||
let get_object_reader = <Self as crate::storage_api_contracts::ObjectIO>::get_object_reader(
|
||||
let get_object_reader = <Self as crate::storage_api_contracts::object::ObjectIO>::get_object_reader(
|
||||
self,
|
||||
bucket,
|
||||
object,
|
||||
@@ -3506,7 +3508,7 @@ impl SetDisks {
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::ListOperations for SetDisks {
|
||||
impl crate::storage_api_contracts::list::ListOperations for SetDisks {
|
||||
type Error = Error;
|
||||
type ListObjectsV2Info = ListObjectsV2Info;
|
||||
type ListObjectVersionsInfo = ListObjectVersionsInfo;
|
||||
@@ -3567,7 +3569,7 @@ impl crate::storage_api_contracts::ListOperations for SetDisks {
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::MultipartOperations for SetDisks {
|
||||
impl crate::storage_api_contracts::multipart::MultipartOperations for SetDisks {
|
||||
type Error = Error;
|
||||
type ObjectInfo = ObjectInfo;
|
||||
type ObjectOptions = ObjectOptions;
|
||||
@@ -4675,7 +4677,7 @@ impl crate::storage_api_contracts::MultipartOperations for SetDisks {
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::HealOperations for SetDisks {
|
||||
impl crate::storage_api_contracts::heal::HealOperations for SetDisks {
|
||||
type Error = Error;
|
||||
type HealResultItem = HealResultItem;
|
||||
type HealOptions = HealOpts;
|
||||
@@ -5630,10 +5632,10 @@ mod tests {
|
||||
use crate::disk::health_state::RuntimeDriveHealthState;
|
||||
use crate::endpoints::SetupType;
|
||||
use crate::object_api::ObjectInfo;
|
||||
use crate::storage_api_contracts::HealOperations as _;
|
||||
use crate::storage_api_contracts::ListOperations as _;
|
||||
use crate::storage_api_contracts::TransitionedObject;
|
||||
use crate::storage_api_contracts::{CompletePart, NamespaceLocking as _, ObjectOperations as _};
|
||||
use crate::storage_api_contracts::{
|
||||
heal::HealOperations as _, lifecycle::TransitionedObject, list::ListOperations as _, multipart::CompletePart,
|
||||
namespace::NamespaceLocking as _, object::ObjectOperations as _,
|
||||
};
|
||||
use crate::store_init::save_format_file;
|
||||
use crate::store_list_objects::ListPathOptions;
|
||||
use rustfs_filemeta::ErasureInfo;
|
||||
@@ -7451,7 +7453,7 @@ mod tests {
|
||||
..Default::default()
|
||||
};
|
||||
let opts = ObjectOptions {
|
||||
object_lock_retention: Some(crate::storage_api_contracts::ObjectLockRetentionOptions {
|
||||
object_lock_retention: Some(crate::storage_api_contracts::object::ObjectLockRetentionOptions {
|
||||
mode: Some(s3s::dto::ObjectLockRetentionMode::COMPLIANCE.to_string()),
|
||||
retain_until: Some(requested_until),
|
||||
bypass_governance: true,
|
||||
@@ -7486,7 +7488,7 @@ mod tests {
|
||||
..Default::default()
|
||||
};
|
||||
let opts = ObjectOptions {
|
||||
object_lock_retention: Some(crate::storage_api_contracts::ObjectLockRetentionOptions {
|
||||
object_lock_retention: Some(crate::storage_api_contracts::object::ObjectLockRetentionOptions {
|
||||
mode: Some(s3s::dto::ObjectLockRetentionMode::GOVERNANCE.to_string()),
|
||||
retain_until: Some(requested_until),
|
||||
bypass_governance: true,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
use super::*;
|
||||
use crate::storage_api_contracts::NamespaceLocking as _;
|
||||
use crate::storage_api_contracts::namespace::NamespaceLocking as _;
|
||||
use rustfs_config::{DEFAULT_OBJECT_ZERO_COPY_ENABLE, ENV_OBJECT_ZERO_COPY_ENABLE};
|
||||
|
||||
const LOG_COMPONENT_ECSTORE: &str = "ecstore";
|
||||
|
||||
+13
-14
@@ -16,14 +16,13 @@
|
||||
use crate::disk::error_reduce::count_errs;
|
||||
use crate::error::{Error, Result};
|
||||
use crate::layout::set_heal::{formats_to_drives_info, new_heal_format_sets};
|
||||
use crate::storage_api_contracts::CompletePart;
|
||||
use crate::storage_api_contracts::HTTPRangeSpec;
|
||||
use crate::storage_api_contracts::{
|
||||
BucketInfo, BucketOperations, BucketOptions, DeleteBucketOptions, DeletedObject, ListMultipartsInfo, ListPartsInfo,
|
||||
MakeBucketOptions, MultipartInfo, MultipartUploadResult, ObjectToDelete, PartInfo, StorageListObjectVersionsInfo,
|
||||
StorageListObjectsV2Info, StorageObjectInfoOrErr, StorageWalkOptions,
|
||||
bucket::{BucketInfo, BucketOperations, BucketOptions, DeleteBucketOptions, MakeBucketOptions},
|
||||
list::{StorageListObjectVersionsInfo, StorageListObjectsV2Info, StorageObjectInfoOrErr, StorageWalkOptions},
|
||||
multipart::{CompletePart, ListMultipartsInfo, ListPartsInfo, MultipartInfo, MultipartUploadResult, PartInfo},
|
||||
object::{DeletedObject, ObjectIO as _, ObjectOperations as _, ObjectToDelete},
|
||||
range::HTTPRangeSpec,
|
||||
};
|
||||
use crate::storage_api_contracts::{ObjectIO as _, ObjectOperations as _};
|
||||
use crate::{
|
||||
disk::{
|
||||
DiskAPI, DiskOption, DiskStore,
|
||||
@@ -400,7 +399,7 @@ fn apply_delete_objects_results(
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::ObjectIO for Sets {
|
||||
impl crate::storage_api_contracts::object::ObjectIO for Sets {
|
||||
type Error = Error;
|
||||
type RangeSpec = HTTPRangeSpec;
|
||||
type HeaderMap = HeaderMap;
|
||||
@@ -493,7 +492,7 @@ impl BucketOperations for Sets {
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::ObjectOperations for Sets {
|
||||
impl crate::storage_api_contracts::object::ObjectOperations for Sets {
|
||||
type Error = Error;
|
||||
type ObjectInfo = ObjectInfo;
|
||||
type ObjectOptions = ObjectOptions;
|
||||
@@ -701,7 +700,7 @@ impl crate::storage_api_contracts::ObjectOperations for Sets {
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::ListOperations for Sets {
|
||||
impl crate::storage_api_contracts::list::ListOperations for Sets {
|
||||
type Error = Error;
|
||||
type ListObjectsV2Info = ListObjectsV2Info;
|
||||
type ListObjectVersionsInfo = ListObjectVersionsInfo;
|
||||
@@ -762,7 +761,7 @@ impl crate::storage_api_contracts::ListOperations for Sets {
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::MultipartOperations for Sets {
|
||||
impl crate::storage_api_contracts::multipart::MultipartOperations for Sets {
|
||||
type Error = Error;
|
||||
type ObjectInfo = ObjectInfo;
|
||||
type ObjectOptions = ObjectOptions;
|
||||
@@ -876,7 +875,7 @@ impl crate::storage_api_contracts::MultipartOperations for Sets {
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::HealOperations for Sets {
|
||||
impl crate::storage_api_contracts::heal::HealOperations for Sets {
|
||||
type Error = Error;
|
||||
type HealResultItem = HealResultItem;
|
||||
type HealOptions = HealOpts;
|
||||
@@ -1016,7 +1015,7 @@ impl crate::storage_api_contracts::HealOperations for Sets {
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::NamespaceLocking for Sets {
|
||||
impl crate::storage_api_contracts::namespace::NamespaceLocking for Sets {
|
||||
type Error = Error;
|
||||
type NamespaceLock = NamespaceLockWrapper;
|
||||
|
||||
@@ -1092,8 +1091,8 @@ async fn init_storage_disks_with_errors(
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::layout::endpoint::Endpoint;
|
||||
use crate::storage_api_contracts::HealOperations as _;
|
||||
use crate::storage_api_contracts::ListOperations as _;
|
||||
use crate::storage_api_contracts::heal::HealOperations as _;
|
||||
use crate::storage_api_contracts::list::ListOperations as _;
|
||||
|
||||
#[test]
|
||||
fn test_apply_delete_objects_results_preserves_original_order_for_out_of_order_batches() {
|
||||
|
||||
@@ -1,43 +1,93 @@
|
||||
use crate::error::Error;
|
||||
use crate::object_api::{GetObjectReader, ObjectInfo, ObjectOptions, PutObjReader};
|
||||
use rustfs_filemeta::FileInfo;
|
||||
pub use rustfs_storage_api::{
|
||||
BucketInfo, BucketOperations, BucketOptions, CapabilityStatus, CompletePart, DeleteBucketOptions, DeletedObject,
|
||||
DiskCapabilities, DiskSetSelector, ExpirationOptions, HTTPPreconditions, HTTPRangeError, HTTPRangeSpec, HealOperations,
|
||||
ListMultipartsInfo, ListObjectVersionsInfo as StorageListObjectVersionsInfo, ListObjectsInfo,
|
||||
ListObjectsV2Info as StorageListObjectsV2Info, ListOperations, ListPartsInfo, MakeBucketOptions, MultipartInfo,
|
||||
MultipartOperations, MultipartUploadResult, NamespaceLocking, ObjectIO, ObjectInfoOrErr as StorageObjectInfoOrErr,
|
||||
ObjectLockRetentionOptions, ObjectOperations, ObjectPreconditionError, ObjectPreconditionPart, ObjectPreconditionState,
|
||||
ObjectToDelete, PartInfo, StorageAdminApi, StorageErrorCode, TopologyCapabilities, TopologyDisk, TopologyLabels,
|
||||
TopologyPool, TopologySet, TopologySnapshot, TransitionedObject, VersionMarker, WalkOptions as StorageWalkOptions,
|
||||
WalkVersionsSortOrder,
|
||||
};
|
||||
use std::fmt::Debug;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
type ListObjectsV2Info = StorageListObjectsV2Info<ObjectInfo>;
|
||||
type ListObjectVersionsInfo = StorageListObjectVersionsInfo<ObjectInfo>;
|
||||
type ObjectInfoOrErr = StorageObjectInfoOrErr<ObjectInfo, Error>;
|
||||
type WalkOptions = StorageWalkOptions<fn(&FileInfo) -> bool>;
|
||||
|
||||
pub(crate) trait EcstoreObjectIO:
|
||||
ObjectIO<
|
||||
Error = Error,
|
||||
RangeSpec = HTTPRangeSpec,
|
||||
HeaderMap = http::HeaderMap,
|
||||
ObjectOptions = ObjectOptions,
|
||||
ObjectInfo = ObjectInfo,
|
||||
GetObjectReader = GetObjectReader,
|
||||
PutObjectReader = PutObjReader,
|
||||
> + Send
|
||||
+ Sync
|
||||
+ Debug
|
||||
+ 'static
|
||||
{
|
||||
pub(crate) mod admin {
|
||||
pub(crate) use rustfs_storage_api::{DiskSetSelector, StorageAdminApi};
|
||||
}
|
||||
|
||||
impl<T> EcstoreObjectIO for T where
|
||||
T: ObjectIO<
|
||||
pub(crate) mod bucket {
|
||||
pub(crate) use rustfs_storage_api::{BucketInfo, BucketOperations, BucketOptions, DeleteBucketOptions, MakeBucketOptions};
|
||||
}
|
||||
|
||||
pub(crate) mod error {
|
||||
pub(crate) use rustfs_storage_api::StorageErrorCode;
|
||||
}
|
||||
|
||||
pub(crate) mod heal {
|
||||
pub(crate) use rustfs_storage_api::HealOperations;
|
||||
}
|
||||
|
||||
pub(crate) mod lifecycle {
|
||||
pub use rustfs_storage_api::{ExpirationOptions, TransitionedObject};
|
||||
}
|
||||
|
||||
pub(crate) mod list {
|
||||
use super::{Debug, Error, FileInfo, ObjectInfo};
|
||||
pub(crate) use rustfs_storage_api::{
|
||||
ListObjectVersionsInfo as StorageListObjectVersionsInfo, ListObjectsInfo, ListObjectsV2Info as StorageListObjectsV2Info,
|
||||
ListOperations, ObjectInfoOrErr as StorageObjectInfoOrErr, VersionMarker, WalkOptions as StorageWalkOptions,
|
||||
WalkVersionsSortOrder,
|
||||
};
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
type ListObjectsV2Info = StorageListObjectsV2Info<ObjectInfo>;
|
||||
type ListObjectVersionsInfo = StorageListObjectVersionsInfo<ObjectInfo>;
|
||||
type ObjectInfoOrErr = StorageObjectInfoOrErr<ObjectInfo, Error>;
|
||||
type WalkOptions = StorageWalkOptions<fn(&FileInfo) -> bool>;
|
||||
|
||||
pub(crate) trait EcstoreListOperations:
|
||||
ListOperations<
|
||||
Error = Error,
|
||||
ListObjectsV2Info = ListObjectsV2Info,
|
||||
ListObjectVersionsInfo = ListObjectVersionsInfo,
|
||||
ObjectInfoOrErr = ObjectInfoOrErr,
|
||||
WalkOptions = WalkOptions,
|
||||
WalkCancellation = CancellationToken,
|
||||
WalkResultSender = tokio::sync::mpsc::Sender<ObjectInfoOrErr>,
|
||||
> + Send
|
||||
+ Sync
|
||||
+ Debug
|
||||
{
|
||||
}
|
||||
|
||||
impl<T> EcstoreListOperations for T where
|
||||
T: ListOperations<
|
||||
Error = Error,
|
||||
ListObjectsV2Info = ListObjectsV2Info,
|
||||
ListObjectVersionsInfo = ListObjectVersionsInfo,
|
||||
ObjectInfoOrErr = ObjectInfoOrErr,
|
||||
WalkOptions = WalkOptions,
|
||||
WalkCancellation = CancellationToken,
|
||||
WalkResultSender = tokio::sync::mpsc::Sender<ObjectInfoOrErr>,
|
||||
> + Send
|
||||
+ Sync
|
||||
+ Debug
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) mod multipart {
|
||||
pub(crate) use rustfs_storage_api::{
|
||||
CompletePart, ListMultipartsInfo, ListPartsInfo, MultipartInfo, MultipartOperations, MultipartUploadResult, PartInfo,
|
||||
};
|
||||
}
|
||||
|
||||
pub(crate) mod namespace {
|
||||
pub(crate) use rustfs_storage_api::NamespaceLocking;
|
||||
}
|
||||
|
||||
pub(crate) mod object {
|
||||
use super::{Debug, Error, FileInfo, GetObjectReader, ObjectInfo, ObjectOptions, PutObjReader};
|
||||
use crate::storage_api_contracts::range::HTTPRangeSpec;
|
||||
pub(crate) use rustfs_storage_api::{
|
||||
DeletedObject, HTTPPreconditions, ObjectIO, ObjectLockRetentionOptions, ObjectOperations, ObjectPreconditionError,
|
||||
ObjectPreconditionPart, ObjectPreconditionState, ObjectToDelete,
|
||||
};
|
||||
|
||||
pub(crate) trait EcstoreObjectIO:
|
||||
ObjectIO<
|
||||
Error = Error,
|
||||
RangeSpec = HTTPRangeSpec,
|
||||
HeaderMap = http::HeaderMap,
|
||||
@@ -49,25 +99,27 @@ impl<T> EcstoreObjectIO for T where
|
||||
+ Sync
|
||||
+ Debug
|
||||
+ 'static
|
||||
{
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
pub(crate) trait EcstoreObjectOperations:
|
||||
ObjectOperations<
|
||||
Error = Error,
|
||||
ObjectInfo = ObjectInfo,
|
||||
ObjectOptions = ObjectOptions,
|
||||
FileInfo = FileInfo,
|
||||
ObjectToDelete = ObjectToDelete,
|
||||
DeletedObject = DeletedObject,
|
||||
> + Send
|
||||
+ Sync
|
||||
+ Debug
|
||||
{
|
||||
}
|
||||
impl<T> EcstoreObjectIO for T where
|
||||
T: ObjectIO<
|
||||
Error = Error,
|
||||
RangeSpec = HTTPRangeSpec,
|
||||
HeaderMap = http::HeaderMap,
|
||||
ObjectOptions = ObjectOptions,
|
||||
ObjectInfo = ObjectInfo,
|
||||
GetObjectReader = GetObjectReader,
|
||||
PutObjectReader = PutObjReader,
|
||||
> + Send
|
||||
+ Sync
|
||||
+ Debug
|
||||
+ 'static
|
||||
{
|
||||
}
|
||||
|
||||
impl<T> EcstoreObjectOperations for T where
|
||||
T: ObjectOperations<
|
||||
pub(crate) trait EcstoreObjectOperations:
|
||||
ObjectOperations<
|
||||
Error = Error,
|
||||
ObjectInfo = ObjectInfo,
|
||||
ObjectOptions = ObjectOptions,
|
||||
@@ -77,35 +129,31 @@ impl<T> EcstoreObjectOperations for T where
|
||||
> + Send
|
||||
+ Sync
|
||||
+ Debug
|
||||
{
|
||||
{
|
||||
}
|
||||
|
||||
impl<T> EcstoreObjectOperations for T where
|
||||
T: ObjectOperations<
|
||||
Error = Error,
|
||||
ObjectInfo = ObjectInfo,
|
||||
ObjectOptions = ObjectOptions,
|
||||
FileInfo = FileInfo,
|
||||
ObjectToDelete = ObjectToDelete,
|
||||
DeletedObject = DeletedObject,
|
||||
> + Send
|
||||
+ Sync
|
||||
+ Debug
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) trait EcstoreListOperations:
|
||||
ListOperations<
|
||||
Error = Error,
|
||||
ListObjectsV2Info = ListObjectsV2Info,
|
||||
ListObjectVersionsInfo = ListObjectVersionsInfo,
|
||||
ObjectInfoOrErr = ObjectInfoOrErr,
|
||||
WalkOptions = WalkOptions,
|
||||
WalkCancellation = CancellationToken,
|
||||
WalkResultSender = tokio::sync::mpsc::Sender<ObjectInfoOrErr>,
|
||||
> + Send
|
||||
+ Sync
|
||||
+ Debug
|
||||
{
|
||||
pub(crate) mod range {
|
||||
pub(crate) use rustfs_storage_api::{HTTPRangeError, HTTPRangeSpec};
|
||||
}
|
||||
|
||||
impl<T> EcstoreListOperations for T where
|
||||
T: ListOperations<
|
||||
Error = Error,
|
||||
ListObjectsV2Info = ListObjectsV2Info,
|
||||
ListObjectVersionsInfo = ListObjectVersionsInfo,
|
||||
ObjectInfoOrErr = ObjectInfoOrErr,
|
||||
WalkOptions = WalkOptions,
|
||||
WalkCancellation = CancellationToken,
|
||||
WalkResultSender = tokio::sync::mpsc::Sender<ObjectInfoOrErr>,
|
||||
> + Send
|
||||
+ Sync
|
||||
+ Debug
|
||||
{
|
||||
pub(crate) mod topology {
|
||||
pub(crate) use rustfs_storage_api::{
|
||||
CapabilityStatus, DiskCapabilities, TopologyCapabilities, TopologyDisk, TopologyLabels, TopologyPool, TopologySet,
|
||||
TopologySnapshot,
|
||||
};
|
||||
}
|
||||
|
||||
+13
-13
@@ -47,11 +47,11 @@ use crate::rebalance::RebalanceMeta;
|
||||
use crate::rpc::RemoteClient;
|
||||
use crate::runtime_sources;
|
||||
use crate::storage_api_contracts::{
|
||||
BucketInfo, BucketOperations, BucketOptions, CompletePart, DeleteBucketOptions, DeletedObject, ListMultipartsInfo,
|
||||
ListPartsInfo, MakeBucketOptions, MultipartInfo, MultipartUploadResult, ObjectToDelete, PartInfo,
|
||||
};
|
||||
use crate::storage_api_contracts::{
|
||||
HTTPRangeSpec, StorageListObjectVersionsInfo, StorageListObjectsV2Info, StorageObjectInfoOrErr, StorageWalkOptions,
|
||||
bucket::{BucketInfo, BucketOperations, BucketOptions, DeleteBucketOptions, MakeBucketOptions},
|
||||
list::{StorageListObjectVersionsInfo, StorageListObjectsV2Info, StorageObjectInfoOrErr, StorageWalkOptions},
|
||||
multipart::{CompletePart, ListMultipartsInfo, ListPartsInfo, MultipartInfo, MultipartUploadResult, PartInfo},
|
||||
object::{DeletedObject, ObjectToDelete},
|
||||
range::HTTPRangeSpec,
|
||||
};
|
||||
use crate::store_init::{check_disk_fatal_errs, ec_drives_no_config};
|
||||
use crate::tier::tier::TierConfigMgr;
|
||||
@@ -346,7 +346,7 @@ impl ECStore {
|
||||
// }
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::ObjectIO for ECStore {
|
||||
impl crate::storage_api_contracts::object::ObjectIO for ECStore {
|
||||
type Error = Error;
|
||||
type RangeSpec = HTTPRangeSpec;
|
||||
type HeaderMap = HeaderMap;
|
||||
@@ -407,7 +407,7 @@ impl BucketOperations for ECStore {
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::ObjectOperations for ECStore {
|
||||
impl crate::storage_api_contracts::object::ObjectOperations for ECStore {
|
||||
type Error = Error;
|
||||
type ObjectInfo = ObjectInfo;
|
||||
type ObjectOptions = ObjectOptions;
|
||||
@@ -498,7 +498,7 @@ impl crate::storage_api_contracts::ObjectOperations for ECStore {
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::ListOperations for ECStore {
|
||||
impl crate::storage_api_contracts::list::ListOperations for ECStore {
|
||||
type Error = Error;
|
||||
type ListObjectsV2Info = ListObjectsV2Info;
|
||||
type ListObjectVersionsInfo = ListObjectVersionsInfo;
|
||||
@@ -563,7 +563,7 @@ impl crate::storage_api_contracts::ListOperations for ECStore {
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::MultipartOperations for ECStore {
|
||||
impl crate::storage_api_contracts::multipart::MultipartOperations for ECStore {
|
||||
type Error = Error;
|
||||
type ObjectInfo = ObjectInfo;
|
||||
type ObjectOptions = ObjectOptions;
|
||||
@@ -687,7 +687,7 @@ impl crate::storage_api_contracts::MultipartOperations for ECStore {
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::HealOperations for ECStore {
|
||||
impl crate::storage_api_contracts::heal::HealOperations for ECStore {
|
||||
type Error = Error;
|
||||
type HealResultItem = HealResultItem;
|
||||
type HealOptions = HealOpts;
|
||||
@@ -724,7 +724,7 @@ impl crate::storage_api_contracts::HealOperations for ECStore {
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::NamespaceLocking for ECStore {
|
||||
impl crate::storage_api_contracts::namespace::NamespaceLocking for ECStore {
|
||||
type Error = Error;
|
||||
type NamespaceLock = NamespaceLockWrapper;
|
||||
|
||||
@@ -734,7 +734,7 @@ impl crate::storage_api_contracts::NamespaceLocking for ECStore {
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::storage_api_contracts::StorageAdminApi for ECStore {
|
||||
impl crate::storage_api_contracts::admin::StorageAdminApi for ECStore {
|
||||
type BackendInfo = rustfs_madmin::BackendInfo;
|
||||
type StorageInfo = rustfs_madmin::StorageInfo;
|
||||
type Disk = DiskStore;
|
||||
@@ -758,7 +758,7 @@ impl crate::storage_api_contracts::StorageAdminApi for ECStore {
|
||||
#[instrument(skip(self))]
|
||||
async fn disk_set_inventory(
|
||||
&self,
|
||||
selector: crate::storage_api_contracts::DiskSetSelector,
|
||||
selector: crate::storage_api_contracts::admin::DiskSetSelector,
|
||||
) -> Result<Vec<Option<Self::Disk>>> {
|
||||
self.handle_get_disks(selector.pool_idx, selector.set_idx).await
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ use crate::bucket::{
|
||||
};
|
||||
use crate::runtime_sources;
|
||||
use crate::set_disk::get_lock_acquire_timeout;
|
||||
use crate::storage_api_contracts::NamespaceLocking as _;
|
||||
use crate::storage_api_contracts::namespace::NamespaceLocking as _;
|
||||
|
||||
fn should_override_created_from_metadata(created: OffsetDateTime) -> bool {
|
||||
created != OffsetDateTime::UNIX_EPOCH
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
use super::*;
|
||||
use crate::storage_api_contracts::HealOperations as _;
|
||||
use crate::storage_api_contracts::heal::HealOperations as _;
|
||||
|
||||
const LOG_COMPONENT_ECSTORE: &str = "ecstore";
|
||||
const LOG_SUBSYSTEM_HEAL: &str = "heal";
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
use super::*;
|
||||
use crate::storage_api_contracts::MultipartOperations as _;
|
||||
use crate::storage_api_contracts::multipart::MultipartOperations as _;
|
||||
|
||||
impl ECStore {
|
||||
#[instrument(skip(self))]
|
||||
|
||||
@@ -17,7 +17,7 @@ use crate::set_disk::{
|
||||
get_lock_acquire_timeout, get_object_lock_diag_slow_acquire_threshold, get_object_lock_diag_slow_hold_threshold,
|
||||
is_lock_optimization_enabled, is_object_lock_diag_enabled,
|
||||
};
|
||||
use crate::storage_api_contracts::{ObjectIO as _, ObjectOperations as _};
|
||||
use crate::storage_api_contracts::object::{ObjectIO as _, ObjectOperations as _};
|
||||
use rustfs_io_metrics::{
|
||||
record_object_lock_diag_acquire_duration, record_object_lock_diag_hold_duration, record_object_lock_diag_slow_acquire,
|
||||
record_object_lock_diag_slow_hold,
|
||||
@@ -1281,7 +1281,7 @@ impl ECStore {
|
||||
}
|
||||
|
||||
pub(super) async fn handle_verify_object_integrity(&self, bucket: &str, object: &str, opts: &ObjectOptions) -> Result<()> {
|
||||
let get_object_reader = <Self as crate::storage_api_contracts::ObjectIO>::get_object_reader(
|
||||
let get_object_reader = <Self as crate::storage_api_contracts::object::ObjectIO>::get_object_reader(
|
||||
self,
|
||||
bucket,
|
||||
object,
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
use super::*;
|
||||
use crate::layout::pool_space::{ServerPoolsAvailableSpace, build_server_pools_available_space};
|
||||
use crate::runtime_sources;
|
||||
use crate::storage_api_contracts::{NamespaceLocking as _, ObjectOperations as _, StorageAdminApi};
|
||||
use crate::storage_api_contracts::{admin::StorageAdminApi, namespace::NamespaceLocking as _, object::ObjectOperations as _};
|
||||
pub(in crate::store) mod support;
|
||||
use support::{
|
||||
LatestObjectInfoCandidate, PoolErr, PoolObjInfo, RebalanceDeletePoolResult, pool_lookup_not_found_error,
|
||||
|
||||
@@ -25,8 +25,11 @@ use crate::object_api::{ObjectInfo, ObjectOptions};
|
||||
use crate::set_disk::SetDisks;
|
||||
use crate::sets::Sets;
|
||||
use crate::storage_api_contracts::{
|
||||
ListObjectsInfo as StorageListObjectsInfo, ObjectOperations as _, StorageListObjectVersionsInfo, StorageListObjectsV2Info,
|
||||
StorageObjectInfoOrErr, StorageWalkOptions, VersionMarker, WalkVersionsSortOrder,
|
||||
list::{
|
||||
ListObjectsInfo as StorageListObjectsInfo, StorageListObjectVersionsInfo, StorageListObjectsV2Info,
|
||||
StorageObjectInfoOrErr, StorageWalkOptions, VersionMarker, WalkVersionsSortOrder,
|
||||
},
|
||||
object::ObjectOperations as _,
|
||||
};
|
||||
use crate::store::ECStore;
|
||||
use crate::store_utils::is_reserved_or_invalid_bucket;
|
||||
|
||||
@@ -38,7 +38,10 @@ use tracing::{debug, error, info, warn};
|
||||
|
||||
use crate::client::admin_handler_utils::AdminError;
|
||||
use crate::error::{Error, Result, StorageError};
|
||||
use crate::storage_api_contracts::{DeletedObject, HTTPRangeSpec, ObjectIO, ObjectOperations, ObjectToDelete};
|
||||
use crate::storage_api_contracts::{
|
||||
object::{DeletedObject, EcstoreObjectIO, EcstoreObjectOperations, ObjectIO, ObjectOperations, ObjectToDelete},
|
||||
range::HTTPRangeSpec,
|
||||
};
|
||||
use crate::tier::{
|
||||
tier_admin::TierCreds,
|
||||
tier_config::{TierConfig, TierType},
|
||||
@@ -50,7 +53,6 @@ use crate::{
|
||||
disk::{MIGRATING_META_BUCKET, RUSTFS_META_BUCKET},
|
||||
object_api::{GetObjectReader, ObjectInfo, ObjectOptions, PutObjReader},
|
||||
runtime_sources,
|
||||
storage_api_contracts::{EcstoreObjectIO, EcstoreObjectOperations},
|
||||
store::ECStore,
|
||||
};
|
||||
use rustfs_filemeta::FileInfo;
|
||||
|
||||
@@ -5,13 +5,13 @@ Status values: `[ ]` not started, `[~]` in progress, `[x]` complete, `[!]` block
|
||||
## Current Context
|
||||
|
||||
- Issue: [`rustfs/backlog#660`](https://github.com/rustfs/backlog/issues/660)
|
||||
- Branch: `overtrue/arch-rustfs-storage-contract-domain-imports`
|
||||
- Baseline: completed `C-011/C-012/C-013/API-055/API-059/API-079/API-080/API-081/API-082/API-083/API-084/API-085/API-086/API-087/API-088/API-089/API-090/API-091/API-092/API-093/API-094/API-095/API-096/API-097/API-098/API-099/API-100/API-101/API-102/API-103/API-104/API-105/API-106/API-107/API-108/API-109/API-110/API-111/API-112/API-113/API-114/API-115/API-116/API-117/API-118/API-119/API-120/API-121/API-122/API-123/API-124/API-125/API-126/API-127/API-128/API-129/API-130/API-131/API-132/API-133/API-134/API-135/API-136/API-137/API-138/API-139/API-140/API-141/API-142/API-143/API-144/API-145/API-146/API-147/API-148/API-149/API-150/API-151/API-152/API-153/API-154/API-155/API-156/API-157/API-158/API-159/API-160/API-161/API-162/API-163/API-164/API-165/API-166/API-167/API-168/API-169/API-170/API-171/API-172/API-173/API-174/API-175/API-176/API-177/API-178/API-179/API-180/API-181/API-182/API-183/API-184/API-185/API-186/API-187/API-188/API-189/API-190/API-191/API-192/API-193/API-194/API-195/API-196/API-197/API-198/API-199/API-200/API-201/API-202/API-203/API-204/API-205/API-206/API-207/API-208/API-209/API-210/API-211/API-212/API-213/API-214/API-215/API-216/API-217/API-218/API-219/API-220/API-221/API-222/API-223/API-224/API-225/API-226/API-227/API-228/API-229/API-230/API-231/API-232/API-233/API-234/API-235/API-236/API-237/API-238/API-239/API-240/API-241/API-242/CTX-002`.
|
||||
- Based on: rebased onto current `origin/main` after PR #3908 merged.
|
||||
- Branch: `overtrue/arch-storage-contract-boundary-batch`
|
||||
- Baseline: completed `C-011/C-012/C-013/API-055/API-059/API-079/API-080/API-081/API-082/API-083/API-084/API-085/API-086/API-087/API-088/API-089/API-090/API-091/API-092/API-093/API-094/API-095/API-096/API-097/API-098/API-099/API-100/API-101/API-102/API-103/API-104/API-105/API-106/API-107/API-108/API-109/API-110/API-111/API-112/API-113/API-114/API-115/API-116/API-117/API-118/API-119/API-120/API-121/API-122/API-123/API-124/API-125/API-126/API-127/API-128/API-129/API-130/API-131/API-132/API-133/API-134/API-135/API-136/API-137/API-138/API-139/API-140/API-141/API-142/API-143/API-144/API-145/API-146/API-147/API-148/API-149/API-150/API-151/API-152/API-153/API-154/API-155/API-156/API-157/API-158/API-159/API-160/API-161/API-162/API-163/API-164/API-165/API-166/API-167/API-168/API-169/API-170/API-171/API-172/API-173/API-174/API-175/API-176/API-177/API-178/API-179/API-180/API-181/API-182/API-183/API-184/API-185/API-186/API-187/API-188/API-189/API-190/API-191/API-192/API-193/API-194/API-195/API-196/API-197/API-198/API-199/API-200/API-201/API-202/API-203/API-204/API-205/API-206/API-207/API-208/API-209/API-210/API-211/API-212/API-213/API-214/API-215/API-216/API-217/API-218/API-219/API-220/API-221/API-222/API-223/API-224/API-225/API-226/API-227/API-228/API-229/API-230/API-231/API-232/API-233/API-234/API-235/API-236/API-237/API-238/API-239/API-240/API-241/API-242/API-243/CTX-002`.
|
||||
- Based on: rebased onto current `origin/main` after PR #3909 merged.
|
||||
- PR type for this branch: `consumer-migration`
|
||||
- Runtime behavior changes: none expected for API-243; RustFS storage, admin,
|
||||
and app storage API boundaries still expose the same storage contracts and
|
||||
helper APIs through domain modules.
|
||||
- Runtime behavior changes: none expected for API-244; ECStore still uses the
|
||||
same storage contracts, now exposed from `storage_api_contracts` domain
|
||||
modules instead of its flat root facade.
|
||||
- Rust code changes: route replication pool, outbound TLS generation, runtime
|
||||
region, KMS encryption service, runtime support handles, S3 Select DB,
|
||||
internode RPC metrics, IAM authorization/handler reads, notification
|
||||
@@ -85,7 +85,10 @@ Status values: `[ ]` not started, `[~]` in progress, `[x]` complete, `[!]` block
|
||||
root re-exports, plus RustFS storage owner, admin, and app local storage API
|
||||
contract imports through local `storage_contracts` aliases and domain-module
|
||||
exports instead of root re-exports, plus RustFS app/admin storage helper
|
||||
imports through domain-module exports instead of root re-exports.
|
||||
imports through domain-module exports instead of root re-exports, plus
|
||||
ECStore owner-local `storage_api_contracts` consumers import bucket, list,
|
||||
multipart, object, admin, topology, range, namespace, heal, lifecycle, and
|
||||
error contracts through domain modules instead of the flat root facade.
|
||||
- CI/script changes: lock completed owner and test/fuzz boundaries against
|
||||
bare/glob imports, scattered raw ECStore facade subpaths, and startup
|
||||
runtime/root-server/table/S3/app shared/app bucket/app ECStore/admin facade
|
||||
@@ -95,14 +98,15 @@ Status values: `[ ]` not started, `[~]` in progress, `[x]` complete, `[!]` block
|
||||
event-bridge thin module regressions, plus IAM runtime-source bypasses;
|
||||
accept the reviewed AppContext resolver reverse dependencies in the layer
|
||||
baseline, and block direct admin AppContext resolver consumers outside the
|
||||
admin runtime-source boundary, block root, app usecase, and storage direct AppContext resolver consumers outside their runtime-source boundaries, catch grouped AppContext imports, reject app usecase storage wildcard imports, reject app-layer S3 DTO and ECFS wildcard imports, narrow the object-usecase ECFS layer baseline entry to `FS`, reject direct storage S3 API helper imports from app usecase files, reject direct storage helper imports from app select/usecase files, reject completed app/admin storage helper bypasses, reject app usecase bypasses for migrated storage IO/compression/set-disk helpers, reject app usecase/test bypasses for migrated storage error, ETag, and storage-class helpers, reject app root bucket owner facade bypasses from migrated app consumers, reject app/admin runtime/data-usage root facade regressions, reject admin root storage facade regressions from migrated admin consumers, reject root/server/startup direct storage facade regressions from migrated outer consumers, reject root/server/startup direct storage contract imports from migrated outer consumers, reject app/admin direct storage contract imports from migrated owner consumers, keep app S3 helper imports routed through `app::storage_api`, reject scanner/heal direct ECStore or storage contract imports outside their local `storage_api` boundaries, reject external runtime/test/fuzz ECStore or storage contract imports outside their local `storage_api` boundaries, reject storage owner direct ECStore/storage-api imports outside the owner-local `storage_api` boundary, reject ECStore internal direct storage-api imports outside the owner-local `storage_api_contracts` boundary, reject direct storage ECFS app usecase construction outside the storage S3 API boundary, reject flat root `storage_api` imports outside the new root-local domain modules, reject flat admin `storage_api` imports outside the new admin domain modules, reject flat app `storage_api` imports outside the new app consumer-domain modules, reject flat external crate-local `storage_api` imports outside the new consumer-domain modules, reject residual flat local `storage_api` imports from notify, ECStore tests/benches, and remaining RustFS app storage API type references, reject external/test local storage API root contract re-exports, reject RustFS local storage API root contract re-exports, and reject RustFS app/admin storage helper root re-exports.
|
||||
admin runtime-source boundary, block root, app usecase, and storage direct AppContext resolver consumers outside their runtime-source boundaries, catch grouped AppContext imports, reject app usecase storage wildcard imports, reject app-layer S3 DTO and ECFS wildcard imports, narrow the object-usecase ECFS layer baseline entry to `FS`, reject direct storage S3 API helper imports from app usecase files, reject direct storage helper imports from app select/usecase files, reject completed app/admin storage helper bypasses, reject app usecase bypasses for migrated storage IO/compression/set-disk helpers, reject app usecase/test bypasses for migrated storage error, ETag, and storage-class helpers, reject app root bucket owner facade bypasses from migrated app consumers, reject app/admin runtime/data-usage root facade regressions, reject admin root storage facade regressions from migrated admin consumers, reject root/server/startup direct storage facade regressions from migrated outer consumers, reject root/server/startup direct storage contract imports from migrated outer consumers, reject app/admin direct storage contract imports from migrated owner consumers, keep app S3 helper imports routed through `app::storage_api`, reject scanner/heal direct ECStore or storage contract imports outside their local `storage_api` boundaries, reject external runtime/test/fuzz ECStore or storage contract imports outside their local `storage_api` boundaries, reject storage owner direct ECStore/storage-api imports outside the owner-local `storage_api` boundary, reject ECStore internal direct storage-api imports outside the owner-local `storage_api_contracts` boundary, reject direct storage ECFS app usecase construction outside the storage S3 API boundary, reject flat root `storage_api` imports outside the new root-local domain modules, reject flat admin `storage_api` imports outside the new admin domain modules, reject flat app `storage_api` imports outside the new app consumer-domain modules, reject flat external crate-local `storage_api` imports outside the new consumer-domain modules, reject residual flat local `storage_api` imports from notify, ECStore tests/benches, and remaining RustFS app storage API type references, reject external/test local storage API root contract re-exports, reject RustFS local storage API root contract re-exports, reject RustFS app/admin storage helper root re-exports, and reject ECStore storage_api_contracts root re-exports or root consumers.
|
||||
- Docs changes: record the API-136 through API-242 owner facade,
|
||||
runtime-source, ECFS usecase, root storage API domain-boundary, and admin
|
||||
storage API domain-boundary cleanup, and app storage API consumer-domain
|
||||
cleanup, plus external crate-local and residual local storage API
|
||||
consumer-domain cleanup, external/test storage contract root re-export
|
||||
cleanup, RustFS local storage contract root re-export cleanup, and RustFS
|
||||
app/admin storage helper root re-export cleanup.
|
||||
cleanup, RustFS local storage contract root re-export cleanup, RustFS
|
||||
app/admin storage helper root re-export cleanup, and ECStore
|
||||
storage_api_contracts domain segmentation.
|
||||
|
||||
## Phase 0 Tasks
|
||||
|
||||
@@ -5583,14 +5587,33 @@ Status values: `[ ]` not started, `[~]` in progress, `[x]` complete, `[!]` block
|
||||
guards, diff hygiene, RustFS root storage-api/helper re-export scans, Rust
|
||||
risk scan, and full PR gate before PR.
|
||||
|
||||
- [x] `API-244` Segment ECStore storage_api_contracts by domain module.
|
||||
- Do: split the ECStore owner-local `storage_api_contracts` facade into
|
||||
bucket, list, multipart, object, admin, topology, range, namespace, heal,
|
||||
lifecycle, and error modules, then migrate ECStore internal consumers to
|
||||
those modules.
|
||||
- Acceptance: ECStore no longer exposes `rustfs_storage_api` contracts from
|
||||
the `storage_api_contracts` root, ECStore internal consumers no longer
|
||||
import contract symbols from the flat root facade, and migration rules
|
||||
reject both regressions.
|
||||
- Must preserve: object/list/multipart/heal/admin trait impls, set-disk/sets
|
||||
behavior, lifecycle/tier/replication DTOs, config storage, peer S3 client,
|
||||
range helpers, topology snapshots, and error mappings.
|
||||
- Verification: focused ECStore compile, formatting, migration and layer
|
||||
guards, ECStore root contract re-export/root consumer scans, diff hygiene,
|
||||
Rust risk scan, and full PR gate passed before PR.
|
||||
|
||||
## Next PRs
|
||||
|
||||
1. `consumer-migration`: continue larger owner boundary batches after API-243.
|
||||
1. `consumer-migration`: continue larger owner boundary batches after API-244.
|
||||
|
||||
## Pre-Push Review Log
|
||||
|
||||
| Expert | Status | Notes |
|
||||
|---|---|---|
|
||||
| Quality/architecture | pass | API-244 segments ECStore storage_api_contracts into domain modules instead of a flat root facade. |
|
||||
| Migration preservation | pass | ECStore object/list/multipart/heal/admin trait impls, lifecycle/tier/replication DTOs, config storage, peer S3 client, range helpers, topology snapshots, and error mappings keep the same contracts. |
|
||||
| Testing/verification | pass | Focused ECStore compile, formatting, migration/layer guards, ECStore root contract re-export/root consumer scans, diff hygiene, diff-added Rust risk scan, and full PR gate passed before PR. |
|
||||
| Quality/architecture | pass | API-243 removes RustFS local storage API root contract/helper re-exports and keeps exposure inside domain modules. |
|
||||
| Migration preservation | pass | Storage ECFS/RPC/S3 helpers, admin handlers, app usecases, AppContext fixtures, and test harness consumers keep the same underlying storage contracts and helpers. |
|
||||
| Testing/verification | pass | Focused RustFS compile, formatting, migration/layer guards, root storage-api/helper re-export scans, diff hygiene, diff-added Rust risk scan, and full PR gate passed before PR. |
|
||||
@@ -5861,6 +5884,25 @@ Status values: `[ ]` not started, `[~]` in progress, `[x]` complete, `[!]` block
|
||||
|
||||
Passed before push:
|
||||
|
||||
- Issue #660 API-244 current slice:
|
||||
- Branch freshness check: rebased onto current `origin/main` after PR #3909
|
||||
merged.
|
||||
- `cargo check -p rustfs-ecstore`: passed.
|
||||
- `cargo fmt --all`: passed.
|
||||
- `./scripts/check_architecture_migration_rules.sh`: passed.
|
||||
- `./scripts/check_layer_dependencies.sh`: passed.
|
||||
- ECStore storage_api_contracts root re-export scan: passed; no root
|
||||
`rustfs_storage_api` contract re-exports remain in the facade.
|
||||
- ECStore storage_api_contracts root consumer scan: passed; internal
|
||||
consumers import through domain modules.
|
||||
- Diff-added Rust risk scan: passed; no new production unwrap/expect,
|
||||
numeric cast, String error, Box dyn Error, print macro, or relaxed atomic
|
||||
ordering lines.
|
||||
- `cargo fmt --all --check`: passed.
|
||||
- `git diff --check`: passed.
|
||||
- `make pre-pr`: passed, including 6771 nextest tests passed, 112 skipped,
|
||||
and doctests passed.
|
||||
|
||||
- Issue #660 API-243 current slice:
|
||||
- Branch freshness check: rebased onto current `origin/main` after PR #3908
|
||||
merged.
|
||||
|
||||
@@ -64,6 +64,8 @@ ECSTORE_OBJECT_API_EXTERNAL_ALIAS_ACTUAL_FILE="${TMP_DIR}/ecstore_object_api_ext
|
||||
ECSTORE_OBJECT_API_EXTERNAL_ALIAS_DIFF_FILE="${TMP_DIR}/ecstore_object_api_external_alias_diff.txt"
|
||||
ECSTORE_OBJECT_API_UNAPPROVED_NAME_HITS_FILE="${TMP_DIR}/ecstore_object_api_unapproved_name_hits.txt"
|
||||
STARTUP_PUBLIC_SHIM_HITS_FILE="${TMP_DIR}/startup_public_shim_hits.txt"
|
||||
ECSTORE_STORAGE_API_ROOT_REEXPORT_HITS_FILE="${TMP_DIR}/ecstore_storage_api_root_reexport_hits.txt"
|
||||
ECSTORE_STORAGE_API_ROOT_CONSUMER_HITS_FILE="${TMP_DIR}/ecstore_storage_api_root_consumer_hits.txt"
|
||||
ECSTORE_TEST_DIRECT_API_HITS_FILE="${TMP_DIR}/ecstore_test_direct_api_hits.txt"
|
||||
ECSTORE_BENCH_DIRECT_API_HITS_FILE="${TMP_DIR}/ecstore_bench_direct_api_hits.txt"
|
||||
LOCAL_STORAGE_API_RAW_CONTRACT_PATH_HITS_FILE="${TMP_DIR}/local_storage_api_raw_contract_path_hits.txt"
|
||||
@@ -648,11 +650,11 @@ fi
|
||||
|
||||
require_source_line \
|
||||
"crates/ecstore/src/bucket/lifecycle/core.rs" \
|
||||
"pub use crate::storage_api_contracts::ExpirationOptions;" \
|
||||
"pub use crate::storage_api_contracts::lifecycle::ExpirationOptions;" \
|
||||
"ECStore ExpirationOptions compatibility re-export"
|
||||
require_source_line \
|
||||
"crates/ecstore/src/bucket/lifecycle/bucket_lifecycle_ops.rs" \
|
||||
"pub use crate::storage_api_contracts::TransitionedObject;" \
|
||||
"pub use crate::storage_api_contracts::lifecycle::TransitionedObject;" \
|
||||
"ECStore TransitionedObject compatibility re-export"
|
||||
|
||||
(
|
||||
@@ -687,6 +689,34 @@ if [[ -s "$ECSTORE_DIRECT_STORAGE_API_SOURCE_HITS_FILE" ]]; then
|
||||
report_failure "ECStore modules must route storage-api symbols through crates/ecstore/src/storage_api_contracts.rs: $(paste -sd '; ' "$ECSTORE_DIRECT_STORAGE_API_SOURCE_HITS_FILE")"
|
||||
fi
|
||||
|
||||
(
|
||||
cd "$ROOT_DIR"
|
||||
rg -n --with-filename '^pub(?:\(crate\))? use rustfs_storage_api' \
|
||||
crates/ecstore/src/storage_api_contracts.rs || true
|
||||
) >"$ECSTORE_STORAGE_API_ROOT_REEXPORT_HITS_FILE"
|
||||
|
||||
if [[ -s "$ECSTORE_STORAGE_API_ROOT_REEXPORT_HITS_FILE" ]]; then
|
||||
report_failure "ECStore storage_api_contracts must expose rustfs-storage-api contracts from domain modules, not root re-exports: $(paste -sd '; ' "$ECSTORE_STORAGE_API_ROOT_REEXPORT_HITS_FILE")"
|
||||
fi
|
||||
|
||||
(
|
||||
cd "$ROOT_DIR"
|
||||
{
|
||||
rg -n -U --with-filename 'storage_api_contracts::\{\s*[A-Z]' \
|
||||
crates/ecstore/src \
|
||||
--glob '*.rs' \
|
||||
--glob '!storage_api_contracts.rs' || true
|
||||
rg -n --with-filename 'storage_api_contracts::[A-Z]' \
|
||||
crates/ecstore/src \
|
||||
--glob '*.rs' \
|
||||
--glob '!storage_api_contracts.rs' || true
|
||||
}
|
||||
) >"$ECSTORE_STORAGE_API_ROOT_CONSUMER_HITS_FILE"
|
||||
|
||||
if [[ -s "$ECSTORE_STORAGE_API_ROOT_CONSUMER_HITS_FILE" ]]; then
|
||||
report_failure "ECStore modules must import storage_api_contracts from domain modules, not the root facade: $(paste -sd '; ' "$ECSTORE_STORAGE_API_ROOT_CONSUMER_HITS_FILE")"
|
||||
fi
|
||||
|
||||
(
|
||||
cd "$ROOT_DIR"
|
||||
rg -n --with-filename 'rustfs_ecstore::api::|rustfs_storage_api' \
|
||||
|
||||
Reference in New Issue
Block a user