diff --git a/config/config.md b/config/config.md index a315393c6050..db2f6e010286 100644 --- a/config/config.md +++ b/config/config.md @@ -421,7 +421,7 @@ | `storage` | -- | -- | The data storage options. | | `storage.data_home` | String | `/tmp/greptimedb/` | The working home directory. | | `storage.type` | String | `File` | The storage type used to store the data.
- `File`: the data is stored in the local file system.
- `S3`: the data is stored in the S3 object storage.
- `Gcs`: the data is stored in the Google Cloud Storage.
- `Azblob`: the data is stored in the Azure Blob Storage.
- `Oss`: the data is stored in the Aliyun OSS. | -| `storage.cache_path` | String | Unset | Read cache configuration for object storage such as 'S3' etc, it's configured by default when using object storage. It is recommended to configure it when using object storage for better performance.
A local file directory, defaults to `{data_home}/{remote_name}`. An empty string means disabling. | +| `storage.cache_path` | String | Unset | Read cache configuration for object storage such as 'S3' etc, it's configured by default when using object storage. It is recommended to configure it when using object storage for better performance.
A local file directory, defaults to `{data_home}`. An empty string means disabling. | | `storage.cache_capacity` | String | Unset | The local file cache capacity in bytes. If your disk space is sufficient, it is recommended to set it larger. | | `storage.bucket` | String | Unset | The S3 bucket name.
**It's only used when the storage type is `S3`, `Oss` and `Gcs`**. | | `storage.root` | String | Unset | The S3 data will be stored in the specified prefix, for example, `s3://${bucket}/${root}`.
**It's only used when the storage type is `S3`, `Oss` and `Azblob`**. | diff --git a/config/datanode.example.toml b/config/datanode.example.toml index c40e1b8ac8fc..1b062a4b3af1 100644 --- a/config/datanode.example.toml +++ b/config/datanode.example.toml @@ -294,7 +294,7 @@ data_home = "/tmp/greptimedb/" type = "File" ## Read cache configuration for object storage such as 'S3' etc, it's configured by default when using object storage. It is recommended to configure it when using object storage for better performance. -## A local file directory, defaults to `{data_home}/{remote_name}`. An empty string means disabling. +## A local file directory, defaults to `{data_home}`. An empty string means disabling. ## @toml2docs:none-default #+ cache_path = "" diff --git a/src/datanode/src/store.rs b/src/datanode/src/store.rs index de289f689e2b..64cacd4e8583 100644 --- a/src/datanode/src/store.rs +++ b/src/datanode/src/store.rs @@ -147,10 +147,10 @@ async fn build_cache_layer( }; // Enable object cache by default - // Set the cache_path to be `${data_home}/{name}` by default + // Set the cache_path to be `${data_home}` by default // if it's not present if cache_path.is_none() { - let read_cache_path = join_dir(data_home, &name.to_lowercase()); + let read_cache_path = data_home.to_string(); tokio::fs::create_dir_all(Path::new(&read_cache_path)) .await .context(CreateDirSnafu {