Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cluster_mgr/config/EloqKv.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
eloq_data_path=${OVERRIDE}
ip=${OVERRIDE}
port=${OVERRIDE}
checkpoint_interval=${OVERRIDE}
checkpointer_interval=${OVERRIDE}
enable_data_store=${OVERRIDE}
enable_wal=${OVERRIDE}
enable_io_uring=${OVERRIDE}
Expand Down
3 changes: 1 addition & 2 deletions src/cluster_mgr/config/examples/eloqkv_memory_multi_ng.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ deployment:
install_dir: "/home/${USER}"
enable_wal: false
enable_io_uring: false
checkpoint_interval: 120
checkpointer_interval: 120
tx_service:
tx_host_ports: [10.0.0.1:6379, 10.0.0.2:6379, 10.0.0.3:6379]


Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ deployment:
install_dir: "/home/${USER}"
enable_wal: false
enable_io_uring: false
checkpoint_interval: 120
checkpointer_interval: 120
tx_service:
tx_host_ports: [10.0.0.1:6379]
standby_host_ports: [10.0.0.2:6379]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ deployment:
install_dir: "/home/${USER}"
enable_wal: true
enable_io_uring: false
checkpoint_interval: 120
checkpointer_interval: 120
tx_service:
tx_host_ports: [127.0.0.1:6389]
# client_port: 6389
Expand Down
2 changes: 1 addition & 1 deletion src/cluster_mgr/config/examples/eloqkv_rocks_gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ deployment:
install_dir: "/home/${USER}"
enable_wal: true
enable_io_uring: false
checkpoint_interval: 120
checkpointer_interval: 120
tx_service:
tx_host_ports: [127.0.0.1:6389]
# client_port: 6389
Expand Down
2 changes: 1 addition & 1 deletion src/cluster_mgr/config/examples/eloqkv_rocks_minio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ deployment:
install_dir: "/home/${USER}"
enable_wal: true
enable_io_uring: false
checkpoint_interval: 120
checkpointer_interval: 120
tx_service:
tx_host_ports: [127.0.0.1:6389]
# client_port: 6389
Expand Down
2 changes: 1 addition & 1 deletion src/cluster_mgr/config/examples/eloqkv_rocks_s3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ deployment:
install_dir: "/home/${USER}"
enable_wal: true
enable_io_uring: false
checkpoint_interval: 120
checkpointer_interval: 120
tx_service:
tx_host_ports: [127.0.0.1:6389]
# client_port: 6389
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ deployment:
install_dir: "/home/${USER}"
enable_wal: true
enable_io_uring: true
checkpoint_interval: 120
checkpointer_interval: 120
maxclients: 60000
tx_service:
tx_host_ports: [10.0.0.1:6379]
Expand Down Expand Up @@ -65,4 +65,4 @@ deployment:
host: 10.0.0.3
node_exporter:
url: "https://github.com/prometheus/node_exporter/releases/download/v1.5.0/node_exporter-1.5.0.linux-amd64.tar.gz"
port: 9200
port: 9200
2 changes: 1 addition & 1 deletion src/cluster_mgr/config/examples/eloqkv_rocksdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ deployment:
install_dir: "/mnt/ssd/${USER}/zhouxiao"
enable_wal: true
enable_io_uring: false
checkpoint_interval: 6000
checkpointer_interval: 6000
tx_service:
tx_host_ports: [192.168.122.24:6389]
# enable_cache_replacement: on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ deployment:
install_dir: "/home/${USER}"
enable_wal: false
enable_io_uring: false
checkpoint_interval: 120
checkpointer_interval: 120
tx_service:
tx_host_ports: [192.168.122.24:6379,192.168.122.25:6379,192.168.122.26:6379]
# storage_service:
Expand Down
4 changes: 2 additions & 2 deletions src/cluster_mgr/config/examples/eloqkv_rocksdb_standby.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ deployment:
install_dir: "/home/${USER}"
enable_wal: false
enable_io_uring: false
checkpoint_interval: 120
checkpointer_interval: 120
tx_service:
tx_host_ports: [10.0.0.1:6379]
standby_host_ports: [10.0.0.2:6379|10.0.0.3:6379]
storage_service:
rocksdb: !LOCAL
# path: /tmp
# path: /tmp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ deployment:
install_dir: "/home/${USER}"
enable_wal: true
enable_io_uring: false
checkpoint_interval: 120
checkpointer_interval: 120
tx_service:
tx_host_ports: [10.0.0.1:6379]
standby_host_ports: [10.0.0.2:6379|10.0.0.3:6379]
Expand All @@ -24,4 +24,4 @@ deployment:
bthread_concurrency: 1
storage_service:
rocksdb: !LOCAL
# path: /tmp
# path: /tmp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ deployment:
install_dir: "/home/${USER}"
enable_wal: false
enable_io_uring: false
checkpoint_interval: 120
checkpointer_interval: 120
tx_service:
tx_host_ports: [192.168.122.24:6379]
standby_host_ports: [192.168.122.25:6379]
voter_host_ports: [192.168.122.26:6379]
# storage_service:
# rocksdb: !LOCAL
# # path: /tmp
# # path: /tmp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ deployment:
install_dir: "/home/${USER}"
enable_wal: true
enable_io_uring: false
checkpoint_interval: 120
checkpointer_interval: 120
tx_service:
tx_host_ports: [10.0.0.1:6379]
standby_host_ports: [10.0.0.2:6379]
Expand All @@ -25,4 +25,4 @@ deployment:
bthread_concurrency: 6
storage_service:
rocksdb: !LOCAL
# path: /tmp
# path: /tmp
12 changes: 6 additions & 6 deletions src/cluster_mgr/src/cli/cmd_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1568,9 +1568,9 @@ impl CmdExecutor {
if let Some(interval) = desired.deployment.checkpoint_interval {
if current.deployment.checkpoint_interval != Some(interval) {
merged.deployment.checkpoint_interval = Some(interval);
tx_field_updates.push(format!("checkpoint_interval:{interval}"));
tx_field_updates.push(format!("checkpointer_interval:{interval}"));
changes.push(format!(
"deployment.checkpoint_interval: {:?} -> {:?}",
"deployment.checkpointer_interval: {:?} -> {:?}",
current.deployment.checkpoint_interval,
Some(interval)
));
Expand Down Expand Up @@ -1700,7 +1700,7 @@ impl CmdExecutor {
}

let supported_paths = [
"deployment.checkpoint_interval",
"deployment.checkpointer_interval",
"deployment.cluster_mode",
"deployment.monitor.prometheus.retention_time",
"deployment.monitor.prometheus.retention_size",
Expand Down Expand Up @@ -3067,7 +3067,7 @@ mod tests {
retention_time: Option<&str>,
) -> DeployConfig {
let checkpoint_line = checkpoint_interval
.map(|value| format!(" checkpoint_interval: {value}\n"))
.map(|value| format!(" checkpointer_interval: {value}\n"))
.unwrap_or_default();
let retention_line = retention_time
.map(|value| format!(" retention_time: \"{value}\"\n"))
Expand Down Expand Up @@ -3129,7 +3129,7 @@ deployment:

assert_eq!(
plan.tx_field_updates,
vec!["checkpoint_interval:120".to_string()]
vec!["checkpointer_interval:120".to_string()]
);
assert!(plan.actions.contains(&ReconcileAction::SaveClusterIndex));
assert!(plan
Expand All @@ -3140,7 +3140,7 @@ deployment:
assert!(plan
.changes
.iter()
.any(|change| change.contains("deployment.checkpoint_interval")));
.any(|change| change.contains("deployment.checkpointer_interval")));
assert!(plan
.changes
.iter()
Expand Down
2 changes: 1 addition & 1 deletion src/cluster_mgr/src/cli/task/config_fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ pub static AVAILABLE_FIELDS: Lazy<HashMap<&'static str, FieldMetadata>> = Lazy::
);

fields.insert(
"checkpoint_interval",
"checkpointer_interval",
FieldMetadata {
description: "Interval time (seconds) of checkpoint",
scope: FieldScope::NodeSpecific,
Expand Down
29 changes: 16 additions & 13 deletions src/cluster_mgr/src/cli/task/topology_update_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ impl TopologyUpdateTask {
error!("Invalid boolean value for enable_io_uring: {}", value);
}
}
"checkpoint_interval" => {
"checkpoint_interval" | "checkpointer_interval" => {
if let Ok(interval) = value.parse::<u32>() {
config.checkpoint_interval = Some(interval);
info!("Updated checkpoint_interval to {}", interval);
info!("Updated checkpointer_interval to {}", interval);
} else {
error!("Invalid integer value for checkpoint_interval: {}", value);
error!("Invalid integer value for checkpointer_interval: {}", value);
}
}
"enable_cache_replacement" => {
Expand Down Expand Up @@ -253,7 +253,7 @@ impl TopologyUpdateTask {
|| value == "1"
|| value.to_lowercase() == "yes";
}
"checkpoint_interval" => {
"checkpoint_interval" | "checkpointer_interval" => {
if let Ok(interval) = value.parse::<u32>() {
config.checkpoint_interval = Some(interval);
}
Expand Down Expand Up @@ -620,7 +620,7 @@ impl TopologyUpdateTask {
updated_fields.insert("enable_data_store".to_string(), false);
updated_fields.insert("enable_wal".to_string(), false);
updated_fields.insert("enable_io_uring".to_string(), false);
updated_fields.insert("checkpoint_interval".to_string(), false);
updated_fields.insert("checkpointer_interval".to_string(), false);
updated_fields.insert("enable_cache_replacement".to_string(), false);

// Track additional settings
Expand Down Expand Up @@ -666,10 +666,10 @@ impl TopologyUpdateTask {
updated_lines.push(format!("enable_io_uring={}", config.enable_io_uring));
updated_fields.insert("enable_io_uring".to_string(), true);
}
"checkpoint_interval" => {
"checkpoint_interval" | "checkpointer_interval" => {
if let Some(interval) = config.checkpoint_interval {
updated_lines.push(format!("checkpoint_interval={}", interval));
updated_fields.insert("checkpoint_interval".to_string(), true);
updated_lines.push(format!("checkpointer_interval={}", interval));
updated_fields.insert("checkpointer_interval".to_string(), true);
} else {
// Keep original line if no value provided
updated_lines.push(line.to_string());
Expand Down Expand Up @@ -732,10 +732,13 @@ impl TopologyUpdateTask {
);
}

// Add checkpoint_interval if present and not already updated
// Add checkpointer_interval if present and not already updated
if let Some(interval) = config.checkpoint_interval {
if !updated_fields["checkpoint_interval"] {
updated_lines.insert(insert_position, format!("checkpoint_interval={}", interval));
if !updated_fields["checkpointer_interval"] {
updated_lines.insert(
insert_position,
format!("checkpointer_interval={}", interval),
);
}
}

Expand Down Expand Up @@ -776,9 +779,9 @@ impl TopologyUpdateTask {
result.push_str(&format!("enable_wal={}\n", config.enable_wal));
result.push_str(&format!("enable_io_uring={}\n", config.enable_io_uring));

// Add checkpoint_interval and enable_cache_replacement if present
// Add checkpointer_interval and enable_cache_replacement if present
if let Some(interval) = config.checkpoint_interval {
result.push_str(&format!("checkpoint_interval={}\n", interval));
result.push_str(&format!("checkpointer_interval={}\n", interval));
}

if let Some(enable) = config.enable_cache_replacement {
Expand Down
9 changes: 5 additions & 4 deletions src/cluster_mgr/src/config/deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ pub struct Deployment {
pub hardware: Option<HashMap<String, Hardware>>,
pub enable_wal: Option<bool>,
pub enable_io_uring: Option<bool>,
#[serde(rename = "checkpointer_interval", alias = "checkpoint_interval")]
pub checkpoint_interval: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub enable_tls: Option<bool>,
Expand Down Expand Up @@ -1294,14 +1295,14 @@ impl Deployment {
println!("**WARNING:** Manually modifying `enable_io_uring` in template `EloqKv.ini` is not recommended.");
}

if self.is_empty(&ini, SECTION_LOCAL, "checkpoint_interval") {
if self.is_empty(&ini, SECTION_LOCAL, "checkpointer_interval") {
ini.set(
SECTION_LOCAL,
"checkpoint_interval",
"checkpointer_interval",
Some(self.checkpoint_interval.unwrap_or(60).to_string()),
);
} else {
println!("**WARNING:** Manually modifying `checkpoint_interval` in template `EloqKv.ini` is not recommended.");
println!("**WARNING:** Manually modifying `checkpointer_interval` in template `EloqKv.ini` is not recommended.");
}

if let Some(mode) = self.cluster_mode {
Expand Down Expand Up @@ -2470,7 +2471,7 @@ deployment:
install_dir: "/tmp"
enable_wal: true
enable_io_uring: false
checkpoint_interval: 120
checkpointer_interval: 120
tx_service:
tx_host_ports: [127.0.0.1:6389]
storage_service:
Expand Down
1 change: 1 addition & 0 deletions src/cluster_mgr/src/state/topology_tx_operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ pub struct ConfigJson {
pub enable_wal: bool,
#[serde(default)]
pub enable_io_uring: bool,
#[serde(rename = "checkpointer_interval", alias = "checkpoint_interval")]
pub checkpoint_interval: Option<u32>,
pub enable_cache_replacement: Option<bool>,
#[serde(default)]
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/topology.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ deployment:
enable_io_uring: false
enable_tls: true
cluster_mode: true
checkpoint_interval: 120
checkpointer_interval: 120
hardware:
172.28.10.11:
cpu: 7
Expand Down
Loading