refactor!: add enable_read_cache config to support disable read cache explicitly (#6834)

* refactor: add `enable_read_cache` config to support disable read cache explicitly

Signed-off-by: zyy17 <zyylsxm@gmail.com>

* refactor: if `cache_path` is empty and `enable_read_cache` is true, set the default cache dir

Signed-off-by: zyy17 <zyylsxm@gmail.com>

* refactor: remove the unessary Option type for `ObjectStorageCacheConfig`

Signed-off-by: zyy17 <zyylsxm@gmail.com>

* refactor: sanitize cache config in `DatanodeOptions` and `StandaloneOptions`

Signed-off-by: zyy17 <zyylsxm@gmail.com>

* chore: code review comment

Signed-off-by: zyy17 <zyylsxm@gmail.com>

* chore: apply code review comments

Signed-off-by: zyy17 <zyylsxm@gmail.com>

---------

Signed-off-by: zyy17 <zyylsxm@gmail.com>
This commit is contained in:
zyy17
2025-09-26 17:44:12 +08:00
committed by GitHub
parent 195ed73448
commit 0717773f62
10 changed files with 152 additions and 102 deletions

View File

@@ -212,10 +212,9 @@ pub fn get_test_store_config(store_type: &StorageType) -> (ObjectStoreConfig, Te
let mut s3_config = s3_test_config();
if *store_type == StorageType::S3WithCache {
s3_config.cache.cache_path = Some("/tmp/greptimedb_cache".to_string());
s3_config.cache.cache_path = "/tmp/greptimedb_cache".to_string();
} else {
// An empty string means disabling.
s3_config.cache.cache_path = Some("".to_string());
s3_config.cache.enable_read_cache = false;
}
let builder = S3::from(&s3_config.connection);

View File

@@ -1594,6 +1594,7 @@ fn drop_lines_with_inconsistent_results(input: String) -> String {
"max_background_flushes =",
"max_background_compactions =",
"max_background_purges =",
"enable_read_cache =",
];
input