fix(filemeta): inline_data key

This commit is contained in:
weisd
2025-06-11 17:53:53 +08:00
parent bdb7e8d321
commit 2cdd6ad192
4 changed files with 14 additions and 6 deletions

View File

@@ -97,6 +97,11 @@ jobs:
name: rustfs
path: ./target/artifacts
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libglib2.0-dev pkg-config
- name: Run s3s-e2e
timeout-minutes: 10
run: |

View File

@@ -1,4 +1,5 @@
use crate::error::{Error, Result};
use crate::headers::RESERVED_METADATA_PREFIX_LOWER;
use rmp_serde::Serializer;
use rustfs_utils::HashAlgorithm;
use serde::Deserialize;
@@ -9,7 +10,6 @@ use uuid::Uuid;
use crate::headers::RESERVED_METADATA_PREFIX;
use crate::headers::RUSTFS_HEALING;
use crate::headers::X_RUSTFS_INLINE_DATA;
pub const ERASURE_ALGORITHM: &str = "rs-vandermonde";
pub const BLOCK_SIZE_V2: usize = 1024 * 1024; // 1M
@@ -302,10 +302,13 @@ impl FileInfo {
}
pub fn set_inline_data(&mut self) {
self.metadata.insert(X_RUSTFS_INLINE_DATA.to_owned(), "true".to_owned());
self.metadata
.insert(format!("{}inline-data", RESERVED_METADATA_PREFIX_LOWER).to_owned(), "true".to_owned());
}
pub fn inline_data(&self) -> bool {
self.metadata.get(X_RUSTFS_INLINE_DATA).is_some_and(|v| v == "true")
self.metadata
.contains_key(format!("{}inline-data", RESERVED_METADATA_PREFIX_LOWER).as_str())
&& !self.is_remote()
}
/// Check if the object is compressed

View File

@@ -1855,12 +1855,12 @@ impl MetaObject {
pub fn inlinedata(&self) -> bool {
self.meta_sys
.contains_key(format!("{}inline", RESERVED_METADATA_PREFIX_LOWER).as_str())
.contains_key(format!("{}inline-data", RESERVED_METADATA_PREFIX_LOWER).as_str())
}
pub fn reset_inline_data(&mut self) {
self.meta_sys
.remove(format!("{}inline", RESERVED_METADATA_PREFIX_LOWER).as_str());
.remove(format!("{}inline-data", RESERVED_METADATA_PREFIX_LOWER).as_str());
}
/// Remove restore headers

View File

@@ -9,7 +9,7 @@ pub const RESERVED_METADATA_PREFIX_LOWER: &str = "x-rustfs-internal-";
pub const RUSTFS_HEALING: &str = "X-Rustfs-Internal-healing";
// pub const RUSTFS_DATA_MOVE: &str = "X-Rustfs-Internal-data-mov";
pub const X_RUSTFS_INLINE_DATA: &str = "x-rustfs-inline-data";
// pub const X_RUSTFS_INLINE_DATA: &str = "x-rustfs-inline-data";
pub const VERSION_PURGE_STATUS_KEY: &str = "X-Rustfs-Internal-purgestatus";