From 29218b5fe7fafc9e0a2bd7d1845e83413b86b8d5 Mon Sep 17 00:00:00 2001 From: jeremyhi Date: Fri, 7 Feb 2025 21:06:50 +0800 Subject: [PATCH] refactor!: unify the option names across all components part2 (#5476) * refactor: part2, replace old options in doc yaml * chore: remove deprecated options * chore: update config.md * fix: ut --- README.md | 2 +- config/config.md | 3 --- config/datanode.example.toml | 12 ------------ docker/docker-compose/cluster-with-etcd.yaml | 14 +++++++------- src/cmd/tests/cli.rs | 4 ++-- src/cmd/tests/load_config_test.rs | 6 ------ tests/runner/src/env.rs | 14 +++++++------- 7 files changed, 17 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 51434ff837..4776aa69f5 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ docker run -p 127.0.0.1:4000-4003:4000-4003 \ --name greptime --rm \ greptime/greptimedb:latest standalone start \ --http-addr 0.0.0.0:4000 \ - --rpc-addr 0.0.0.0:4001 \ + --rpc-bind-addr 0.0.0.0:4001 \ --mysql-addr 0.0.0.0:4002 \ --postgres-addr 0.0.0.0:4003 ``` diff --git a/config/config.md b/config/config.md index 97a227635f..0ad4ba95c1 100644 --- a/config/config.md +++ b/config/config.md @@ -377,9 +377,6 @@ | `init_regions_in_background` | Bool | `false` | Initialize all regions in the background during the startup.
By default, it provides services after all regions have been initialized. | | `init_regions_parallelism` | Integer | `16` | Parallelism of initializing regions. | | `max_concurrent_queries` | Integer | `0` | The maximum current queries allowed to be executed. Zero means unlimited. | -| `rpc_runtime_size` | Integer | Unset | Deprecated, use `grpc.runtime_size` instead. | -| `rpc_max_recv_message_size` | String | Unset | Deprecated, use `grpc.rpc_max_recv_message_size` instead. | -| `rpc_max_send_message_size` | String | Unset | Deprecated, use `grpc.rpc_max_send_message_size` instead. | | `enable_telemetry` | Bool | `true` | Enable telemetry to collect anonymous usage data. Enabled by default. | | `http` | -- | -- | The HTTP server options. | | `http.addr` | String | `127.0.0.1:4000` | The address to bind the HTTP server. | diff --git a/config/datanode.example.toml b/config/datanode.example.toml index a9a73f7176..a4acd1aa89 100644 --- a/config/datanode.example.toml +++ b/config/datanode.example.toml @@ -19,18 +19,6 @@ init_regions_parallelism = 16 ## The maximum current queries allowed to be executed. Zero means unlimited. max_concurrent_queries = 0 -## Deprecated, use `grpc.runtime_size` instead. -## @toml2docs:none-default -rpc_runtime_size = 8 - -## Deprecated, use `grpc.rpc_max_recv_message_size` instead. -## @toml2docs:none-default -rpc_max_recv_message_size = "512MB" - -## Deprecated, use `grpc.rpc_max_send_message_size` instead. -## @toml2docs:none-default -rpc_max_send_message_size = "512MB" - ## Enable telemetry to collect anonymous usage data. Enabled by default. #+ enable_telemetry = true diff --git a/docker/docker-compose/cluster-with-etcd.yaml b/docker/docker-compose/cluster-with-etcd.yaml index 8e1773c7d7..698d96f5a0 100644 --- a/docker/docker-compose/cluster-with-etcd.yaml +++ b/docker/docker-compose/cluster-with-etcd.yaml @@ -43,8 +43,8 @@ services: command: - metasrv - start - - --bind-addr=0.0.0.0:3002 - - --server-addr=metasrv:3002 + - --rpc-bind-addr=0.0.0.0:3002 + - --rpc-server-addr=metasrv:3002 - --store-addrs=etcd0:2379 - --http-addr=0.0.0.0:3000 healthcheck: @@ -68,8 +68,8 @@ services: - datanode - start - --node-id=0 - - --rpc-addr=0.0.0.0:3001 - - --rpc-hostname=datanode0:3001 + - --rpc-bind-addr=0.0.0.0:3001 + - --rpc-server-addr=datanode0:3001 - --metasrv-addrs=metasrv:3002 - --http-addr=0.0.0.0:5000 volumes: @@ -98,7 +98,7 @@ services: - start - --metasrv-addrs=metasrv:3002 - --http-addr=0.0.0.0:4000 - - --rpc-addr=0.0.0.0:4001 + - --rpc-bind-addr=0.0.0.0:4001 - --mysql-addr=0.0.0.0:4002 - --postgres-addr=0.0.0.0:4003 healthcheck: @@ -123,8 +123,8 @@ services: - start - --node-id=0 - --metasrv-addrs=metasrv:3002 - - --rpc-addr=0.0.0.0:4004 - - --rpc-hostname=flownode0:4004 + - --rpc-bind-addr=0.0.0.0:4004 + - --rpc-server-addr=flownode0:4004 - --http-addr=0.0.0.0:4005 depends_on: frontend0: diff --git a/src/cmd/tests/cli.rs b/src/cmd/tests/cli.rs index c2c066f48b..dfea9afc3e 100644 --- a/src/cmd/tests/cli.rs +++ b/src/cmd/tests/cli.rs @@ -63,7 +63,7 @@ mod tests { .args([ "datanode", "start", - "--rpc-addr=0.0.0.0:4321", + "--rpc-bind-addr=0.0.0.0:4321", "--node-id=1", &format!("--data-home={}", data_home.path().display()), &format!("--wal-dir={}", wal_dir.path().display()), @@ -80,7 +80,7 @@ mod tests { "--log-level=off", "cli", "attach", - "--grpc-addr=0.0.0.0:4321", + "--grpc-bind-addr=0.0.0.0:4321", // history commands can sneaky into stdout and mess up our tests, so disable it "--disable-helper", ]); diff --git a/src/cmd/tests/load_config_test.rs b/src/cmd/tests/load_config_test.rs index 3380783822..422ee2372a 100644 --- a/src/cmd/tests/load_config_test.rs +++ b/src/cmd/tests/load_config_test.rs @@ -17,9 +17,6 @@ use std::time::Duration; use cmd::options::GreptimeOptions; use cmd::standalone::StandaloneOptions; use common_config::Configurable; -use common_grpc::channel_manager::{ - DEFAULT_MAX_GRPC_RECV_MESSAGE_SIZE, DEFAULT_MAX_GRPC_SEND_MESSAGE_SIZE, -}; use common_options::datanode::{ClientOptions, DatanodeClientOptions}; use common_telemetry::logging::{LoggingOptions, SlowQueryOptions, DEFAULT_OTLP_ENDPOINT}; use common_wal::config::raft_engine::RaftEngineConfig; @@ -93,9 +90,6 @@ fn test_load_datanode_example_config() { grpc: GrpcOptions::default() .with_bind_addr("127.0.0.1:3001") .with_server_addr("127.0.0.1:3001"), - rpc_runtime_size: Some(8), - rpc_max_recv_message_size: Some(DEFAULT_MAX_GRPC_RECV_MESSAGE_SIZE), - rpc_max_send_message_size: Some(DEFAULT_MAX_GRPC_SEND_MESSAGE_SIZE), ..Default::default() }, ..Default::default() diff --git a/tests/runner/src/env.rs b/tests/runner/src/env.rs index 6c646d1d18..d92bcb34c0 100644 --- a/tests/runner/src/env.rs +++ b/tests/runner/src/env.rs @@ -349,7 +349,7 @@ impl Env { "start".to_string(), "--metasrv-addrs=127.0.0.1:29302".to_string(), "--http-addr=127.0.0.1:29503".to_string(), - format!("--rpc-addr={}", GRPC_SERVER_ADDR), + format!("--rpc-bind-addr={}", GRPC_SERVER_ADDR), format!("--mysql-addr={}", MYSQL_SERVER_ADDR), format!("--postgres-addr={}", POSTGRES_SERVER_ADDR), format!( @@ -373,9 +373,9 @@ impl Env { DEFAULT_LOG_LEVEL.to_string(), subcommand.to_string(), "start".to_string(), - "--bind-addr".to_string(), + "--rpc-bind-addr".to_string(), "127.0.0.1:29302".to_string(), - "--server-addr".to_string(), + "--rpc-server-addr".to_string(), "127.0.0.1:29302".to_string(), "--enable-region-failover".to_string(), "false".to_string(), @@ -457,8 +457,8 @@ impl Env { subcommand.to_string(), "start".to_string(), ]; - args.push(format!("--rpc-addr=127.0.0.1:2941{id}")); - args.push(format!("--rpc-hostname=127.0.0.1:2941{id}")); + args.push(format!("--rpc-bind-addr=127.0.0.1:2941{id}")); + args.push(format!("--rpc-server-addr=127.0.0.1:2941{id}")); args.push(format!("--http-addr=127.0.0.1:2943{id}")); args.push(format!("--data-home={}", data_home.display())); args.push(format!("--log-dir={}/logs", data_home.display())); @@ -482,8 +482,8 @@ impl Env { subcommand.to_string(), "start".to_string(), ]; - args.push(format!("--rpc-addr=127.0.0.1:2968{id}")); - args.push(format!("--rpc-hostname=127.0.0.1:2968{id}")); + args.push(format!("--rpc-bind-addr=127.0.0.1:2968{id}")); + args.push(format!("--rpc-server-addr=127.0.0.1:2968{id}")); args.push(format!("--node-id={id}")); args.push(format!( "--log-dir={}/greptimedb-flownode/logs",