From b30d17f89ca4eb9e7370876ee4562c091c7fcb34 Mon Sep 17 00:00:00 2001 From: jeremyhi Date: Wed, 5 Aug 2026 16:56:55 +0800 Subject: [PATCH] docs: align wal.sync_period documented default with actual fallback (5s) (#8753) The example TOMLs and generated config.md documented the default of wal.sync_period as "10s", but since #5677 moved the WAL sync task to a background RepeatedTask, an unset sync_period falls back to 5s in RaftEngineLogStore. The two paths therefore had different fsync periods: deployments based on the example configs used 10s while bare configs used 5s. Align the documentation with the actual code behavior (5s) instead of changing the code fallback to 10s, so that no existing deployment silently gets a larger data-loss window on host power loss. - config/datanode.example.toml, config/standalone.example.toml: 10s -> 5s - config/config.md: regenerated via make config-docs - src/cmd/tests/load_config_test.rs: update assertions accordingly Signed-off-by: jeremyhi --- config/config.md | 4 ++-- config/datanode.example.toml | 2 +- config/standalone.example.toml | 2 +- src/cmd/tests/load_config_test.rs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/config.md b/config/config.md index a8f108ca53..40272ddcfd 100644 --- a/config/config.md +++ b/config/config.md @@ -96,7 +96,7 @@ | `wal.sync_write` | Bool | `false` | Whether to use sync write.
**It's only used when the provider is `raft_engine`**. | | `wal.enable_log_recycle` | Bool | `true` | Whether to reuse logically truncated log files.
**It's only used when the provider is `raft_engine`**. | | `wal.prefill_log_files` | Bool | `false` | Whether to pre-create log files on start up.
**It's only used when the provider is `raft_engine`**. | -| `wal.sync_period` | String | `10s` | Duration for fsyncing log files.
**It's only used when the provider is `raft_engine`**. | +| `wal.sync_period` | String | `5s` | Duration for fsyncing log files.
**It's only used when the provider is `raft_engine`**. | | `wal.recovery_parallelism` | Integer | `2` | Parallelism during WAL recovery. | | `wal.broker_endpoints` | Array | -- | The Kafka broker endpoints.
**It's only used when the provider is `kafka`**. | | `wal.connect_timeout` | String | `3s` | The connect timeout for kafka client.
**It's only used when the provider is `kafka`**. | @@ -529,7 +529,7 @@ | `wal.sync_write` | Bool | `false` | Whether to use sync write.
**It's only used when the provider is `raft_engine`**. | | `wal.enable_log_recycle` | Bool | `true` | Whether to reuse logically truncated log files.
**It's only used when the provider is `raft_engine`**. | | `wal.prefill_log_files` | Bool | `false` | Whether to pre-create log files on start up.
**It's only used when the provider is `raft_engine`**. | -| `wal.sync_period` | String | `10s` | Duration for fsyncing log files.
**It's only used when the provider is `raft_engine`**. | +| `wal.sync_period` | String | `5s` | Duration for fsyncing log files.
**It's only used when the provider is `raft_engine`**. | | `wal.recovery_parallelism` | Integer | `2` | Parallelism during WAL recovery. | | `wal.broker_endpoints` | Array | -- | The Kafka broker endpoints.
**It's only used when the provider is `kafka`**. | | `wal.connect_timeout` | String | `3s` | The connect timeout for kafka client.
**It's only used when the provider is `kafka`**. | diff --git a/config/datanode.example.toml b/config/datanode.example.toml index 4a2e21595d..3426630d7b 100644 --- a/config/datanode.example.toml +++ b/config/datanode.example.toml @@ -161,7 +161,7 @@ prefill_log_files = false ## Duration for fsyncing log files. ## **It's only used when the provider is `raft_engine`**. -sync_period = "10s" +sync_period = "5s" ## Parallelism during WAL recovery. recovery_parallelism = 2 diff --git a/config/standalone.example.toml b/config/standalone.example.toml index d8a2deca24..d256d681f9 100644 --- a/config/standalone.example.toml +++ b/config/standalone.example.toml @@ -277,7 +277,7 @@ prefill_log_files = false ## Duration for fsyncing log files. ## **It's only used when the provider is `raft_engine`**. -sync_period = "10s" +sync_period = "5s" ## Parallelism during WAL recovery. recovery_parallelism = 2 diff --git a/src/cmd/tests/load_config_test.rs b/src/cmd/tests/load_config_test.rs index bdbaf720b7..aa1d98cf4b 100644 --- a/src/cmd/tests/load_config_test.rs +++ b/src/cmd/tests/load_config_test.rs @@ -103,7 +103,7 @@ fn test_load_datanode_example_config() { }), wal: DatanodeWalConfig::RaftEngine(RaftEngineConfig { dir: Some(format!("{}/{}", DEFAULT_DATA_HOME, WAL_DIR)), - sync_period: Some(Duration::from_secs(10)), + sync_period: Some(Duration::from_secs(5)), recovery_parallelism: 2, ..Default::default() }), @@ -336,7 +336,7 @@ fn test_load_standalone_example_config() { auto_create_table: true, wal: DatanodeWalConfig::RaftEngine(RaftEngineConfig { dir: Some(format!("{}/{}", DEFAULT_DATA_HOME, WAL_DIR)), - sync_period: Some(Duration::from_secs(10)), + sync_period: Some(Duration::from_secs(5)), recovery_parallelism: 2, ..Default::default() }),