mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-12 16:16:55 +00:00
refactor: improve object listing and version handling
- Refactor find_version_index to accept Uuid directly instead of string - Split from_meta_cache_entries_sorted into separate methods for versions and infos - Add support for after_version_id filtering in version listing - Fix S3 error code for replication configuration not found - Improve error handling and logging levels - Clean up import statements and remove debug code
This commit is contained in:
@@ -461,13 +461,7 @@ pub struct FileInfoVersions {
|
||||
}
|
||||
|
||||
impl FileInfoVersions {
|
||||
pub fn find_version_index(&self, v: &str) -> Option<usize> {
|
||||
if v.is_empty() {
|
||||
return None;
|
||||
}
|
||||
|
||||
let vid = Uuid::parse_str(v).unwrap_or_default();
|
||||
|
||||
pub fn find_version_index(&self, vid: Uuid) -> Option<usize> {
|
||||
self.versions.iter().position(|v| v.version_id == Some(vid))
|
||||
}
|
||||
|
||||
|
||||
@@ -2006,11 +2006,7 @@ impl MetaObject {
|
||||
if *status == TRANSITION_COMPLETE.as_bytes().to_vec() {
|
||||
let vid = Uuid::parse_str(&fi.tier_free_version_id());
|
||||
if let Err(err) = vid {
|
||||
panic!(
|
||||
"Invalid Tier Object delete marker versionId {} {}",
|
||||
fi.tier_free_version_id(),
|
||||
err
|
||||
);
|
||||
panic!("Invalid Tier Object delete marker versionId {} {}", fi.tier_free_version_id(), err);
|
||||
}
|
||||
let vid = vid.unwrap();
|
||||
let mut free_entry = FileMetaVersion {
|
||||
|
||||
Reference in New Issue
Block a user