Skip to content

Commit 4d52381

Browse files
committed
add command line option for the inline metadata size
1 parent 207729b commit 4d52381

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,26 @@ cd s3-cas
1818
cargo build --release --features binary
1919
```
2020

21+
## Inline metadata
22+
23+
Objects smaller than or equal to a configurable threshold can be stored directly in their metadata records,
24+
improving performance for small objects.
25+
26+
Configure this feature using the command-line option:
27+
```console
28+
--inline-metadata-size <size> # omit to disable inlining
29+
```
30+
31+
When the size is set:
32+
- If the size of object data + metadata smaller than or equal to the threshold, the object data is stored in the metadata,
33+
otherwise use the standard block storage
34+
- Setting size to 0 or omitting the option disables inlining completely
35+
36+
Currently, objects uploaded using the multipart method will never be inlined
37+
because they are assumed to be large objects.
38+
2139
## Known issues
2240

23-
- The metadata database (sled) has unbounded memory growth related to the objects stored. This means
24-
the server will eventually consume all memory on the host and crash. To fix this the metadata database
25-
should either be replaced with a new version of sled (still in development) or a different one entirely
2641
- Only the basic API is implemented, and even then it is not entirely implemented (for instance copy
2742
between servers is not implemented).
28-
- The codebase is very much POC and not following a good abstraction structure
2943
- Single key only, no support to add multiple keys with different permissions.

src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ struct Args {
3131
#[structopt(long, default_value = "9100")]
3232
metric_port: u16,
3333

34+
#[structopt(long, help = "leave empty to disable it")]
35+
inline_metadata_size: Option<usize>,
36+
3437
#[structopt(long, requires("secret-key"), display_order = 1000)]
3538
access_key: Option<String>,
3639

@@ -71,7 +74,7 @@ async fn run(args: Args) -> anyhow::Result<()> {
7174
args.meta_root.clone(),
7275
metrics.clone(),
7376
storage_engine,
74-
None,
77+
args.inline_metadata_size,
7578
);
7679
let s3fs = s3_cas::s3fs::S3FS::new(args.fs_root, args.meta_root, casfs, metrics.clone());
7780
let s3fs = s3_cas::metrics::MetricFs::new(s3fs, metrics.clone());

src/metastore/stores/fjall.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl std::fmt::Debug for FjallStore {
2626
}
2727
}
2828

29-
const DEFAULT_INLINED_METADATA_SIZE: usize = 1024;
29+
const DEFAULT_INLINED_METADATA_SIZE: usize = 1; // setting very low will practically disable it by default
3030

3131
impl FjallStore {
3232
pub fn new(path: PathBuf, inlined_metadata_size: Option<usize>) -> Self {

0 commit comments

Comments
 (0)