mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-13 08:36:54 +00:00
Merge branch 'main' of github.com:rustfs/s3-rustfs into feature/bucket-event-notification
# Conflicts: # Cargo.toml
This commit is contained in:
@@ -99,7 +99,7 @@ impl FileMeta {
|
||||
|
||||
Ok((bin_len, &buf[5..]))
|
||||
}
|
||||
#[tracing::instrument]
|
||||
|
||||
pub fn unmarshal_msg(&mut self, buf: &[u8]) -> Result<u64> {
|
||||
let i = buf.len() as u64;
|
||||
|
||||
@@ -711,7 +711,6 @@ impl FileMetaVersion {
|
||||
Ok(data_dir)
|
||||
}
|
||||
|
||||
#[tracing::instrument]
|
||||
pub fn unmarshal_msg(&mut self, buf: &[u8]) -> Result<u64> {
|
||||
let mut cur = Cursor::new(buf);
|
||||
|
||||
@@ -998,7 +997,7 @@ impl FileMetaVersionHeader {
|
||||
|
||||
Ok(wr)
|
||||
}
|
||||
#[tracing::instrument]
|
||||
|
||||
pub fn unmarshal_msg(&mut self, buf: &[u8]) -> Result<u64> {
|
||||
let mut cur = Cursor::new(buf);
|
||||
let alen = rmp::decode::read_array_len(&mut cur)?;
|
||||
@@ -1144,7 +1143,6 @@ pub struct MetaObject {
|
||||
}
|
||||
|
||||
impl MetaObject {
|
||||
#[tracing::instrument]
|
||||
pub fn unmarshal_msg(&mut self, buf: &[u8]) -> Result<u64> {
|
||||
let mut cur = Cursor::new(buf);
|
||||
|
||||
|
||||
@@ -344,7 +344,6 @@ impl CurrentScannerCycle {
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
#[tracing::instrument]
|
||||
pub fn unmarshal_msg(&mut self, buf: &[u8]) -> Result<u64> {
|
||||
let mut cur = Cursor::new(buf);
|
||||
|
||||
|
||||
+21
-20
@@ -695,7 +695,7 @@ impl ECStore {
|
||||
let at = a.object_info.mod_time.unwrap_or(OffsetDateTime::UNIX_EPOCH);
|
||||
let bt = b.object_info.mod_time.unwrap_or(OffsetDateTime::UNIX_EPOCH);
|
||||
|
||||
at.cmp(&bt)
|
||||
bt.cmp(&at)
|
||||
});
|
||||
|
||||
let mut def_pool = PoolObjInfo::default();
|
||||
@@ -911,29 +911,30 @@ impl ECStore {
|
||||
|
||||
// TODO: test order
|
||||
idx_res.sort_by(|a, b| {
|
||||
if let Some(obj1) = &a.res {
|
||||
if let Some(obj2) = &b.res {
|
||||
let cmp = obj1.mod_time.cmp(&obj2.mod_time);
|
||||
match cmp {
|
||||
// eq use lowest
|
||||
Ordering::Equal => {
|
||||
if a.idx < b.idx {
|
||||
Ordering::Greater
|
||||
} else {
|
||||
Ordering::Less
|
||||
}
|
||||
}
|
||||
_ => cmp,
|
||||
}
|
||||
} else {
|
||||
Ordering::Greater
|
||||
}
|
||||
let a_mod = if let Some(o1) = &a.res {
|
||||
o1.mod_time.unwrap_or(OffsetDateTime::UNIX_EPOCH)
|
||||
} else {
|
||||
Ordering::Less
|
||||
OffsetDateTime::UNIX_EPOCH
|
||||
};
|
||||
|
||||
let b_mod = if let Some(o2) = &b.res {
|
||||
o2.mod_time.unwrap_or(OffsetDateTime::UNIX_EPOCH)
|
||||
} else {
|
||||
OffsetDateTime::UNIX_EPOCH
|
||||
};
|
||||
|
||||
if a_mod == b_mod {
|
||||
if a.idx < b.idx {
|
||||
return Ordering::Greater;
|
||||
} else {
|
||||
return Ordering::Less;
|
||||
}
|
||||
}
|
||||
|
||||
b_mod.cmp(&a_mod)
|
||||
});
|
||||
|
||||
for res in idx_res {
|
||||
for res in idx_res.into_iter() {
|
||||
if let Some(obj) = res.res {
|
||||
return Ok((obj, res.idx));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user