Skip to content

Commit 86ffe99

Browse files
authored
deprecate(config): deprecate state store url on worker nodes (risingwavelabs#8704)
1 parent 9e774bb commit 86ffe99

File tree

14 files changed

+123
-185
lines changed

14 files changed

+123
-185
lines changed

docker/docker-compose.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ services:
1313
- "0.0.0.0:1260"
1414
- "--metrics-level"
1515
- "1"
16-
- "--state-store"
17-
- "hummock+minio://hummockadmin:hummockadmin@minio-0:9301/hummock001"
1816
- "--meta-address"
1917
- "http://meta-node-0:5690"
2018
- "--config-path"
@@ -52,8 +50,6 @@ services:
5250
- "0.0.0.0:1222"
5351
- "--metrics-level"
5452
- "1"
55-
- "--state-store"
56-
- "hummock+minio://hummockadmin:hummockadmin@minio-0:9301/hummock001"
5753
- "--meta-address"
5854
- "http://meta-node-0:5690"
5955
- "--connector-rpc-endpoint"
@@ -203,6 +199,8 @@ services:
203199
- "etcd-0:2388"
204200
- "--connector-rpc-endpoint"
205201
- "connector-node:50051"
202+
- "--state-store"
203+
- "hummock+minio://hummockadmin:hummockadmin@minio-0:9301/hummock001"
206204
- "--config-path"
207205
- /risingwave.toml
208206
expose:

risedev.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -489,18 +489,16 @@ profile:
489489
- use: etcd
490490
unsafe-no-fsync: true
491491
- use: meta-node
492+
enable-in-memory-kv-state-backend: true
492493
- use: compute-node
493494
port: 5687
494495
exporter-port: 1222
495-
enable-in-memory-kv-state-backend: true
496496
- use: compute-node
497497
port: 5688
498498
exporter-port: 1223
499-
enable-in-memory-kv-state-backend: true
500499
- use: compute-node
501500
port: 5689
502501
exporter-port: 1224
503-
enable-in-memory-kv-state-backend: true
504502
- use: frontend
505503
port: 4565
506504
exporter-port: 2222
@@ -770,18 +768,9 @@ template:
770768
# Jaeger used by this compute node
771769
provide-jaeger: "jaeger*"
772770

773-
# Sanity check: should use shared storage if there're multiple compute nodes
774-
provide-compute-node: "compute-node*"
775-
776-
# Sanity check: should start at lease one compactor if using shared object store
777-
provide-compactor: "compactor*"
778-
779771
# If `user-managed` is true, this service will be started by user with the above config
780772
user-managed: false
781773

782-
# Whether to enable in-memory pure KV state backend
783-
enable-in-memory-kv-state-backend: false
784-
785774
# Total available memory for the compute node in bytes
786775
total-memory-bytes: 8589934592
787776

@@ -826,6 +815,24 @@ template:
826815
# Prometheus nodes used by dashboard service
827816
provide-prometheus: "prometheus*"
828817

818+
# Sanity check: should use shared storage if there're multiple compute nodes
819+
provide-compute-node: "compute-node*"
820+
821+
# Sanity check: should start at lease one compactor if using shared object store
822+
provide-compactor: "compactor*"
823+
824+
# Minio instances used by the cluster
825+
provide-minio: "minio*"
826+
827+
# OpenDAL storage backend used by the cluster
828+
provide-opendal: "opendal*"
829+
830+
# AWS s3 bucket used by the cluster
831+
provide-aws-s3: "aws-s3*"
832+
833+
# Whether to enable in-memory pure KV state backend
834+
enable-in-memory-kv-state-backend: false
835+
829836
prometheus:
830837
# Advertise address of Prometheus
831838
address: "127.0.0.1"
@@ -910,14 +917,9 @@ template:
910917
# Id of this instance
911918
id: compactor-${port}
912919

913-
# Minio instances used by this compute node
920+
# Minio instances used by this compactor
914921
provide-minio: "minio*"
915922

916-
# OpenDAL storage backend used by this compute node
917-
provide-opendal: "opendal*"
918-
# AWS s3 bucket used by this compute node
919-
provide-aws-s3: "aws-s3*"
920-
921923
# Meta-nodes used by this compute node
922924
provide-meta-node: "meta-node*"
923925

src/common/src/system_param/reader.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// limitations under the License.
1414

1515
use risingwave_pb::meta::PbSystemParams;
16-
use tracing::warn;
1716

1817
use super::system_params_to_kv;
1918

@@ -53,15 +52,8 @@ impl SystemParamsReader {
5352
self.prost.bloom_false_positive.unwrap()
5453
}
5554

56-
// TODO(zhidong): Only read from system params in v0.1.18.
57-
pub fn state_store(&self, from_local: String) -> String {
58-
let from_prost = self.prost.state_store.as_ref().unwrap();
59-
if from_prost.is_empty() {
60-
warn!("--state-store is not specified on meta node, reading from CLI instead");
61-
from_local
62-
} else {
63-
from_prost.clone()
64-
}
55+
pub fn state_store(&self) -> &str {
56+
self.prost.state_store.as_ref().unwrap()
6557
}
6658

6759
pub fn data_directory(&self) -> &str {

src/compute/src/lib.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,6 @@ pub struct ComputeNodeOpts {
7070
#[clap(long, env = "RW_CONNECTOR_RPC_SINK_PAYLOAD_FORMAT")]
7171
pub connector_rpc_sink_payload_format: Option<String>,
7272

73-
/// One of:
74-
/// 1. `hummock+{object_store}` where `object_store`
75-
/// is one of `s3://{path}`, `s3-compatible://{path}`, `minio://{path}`, `disk://{path}`,
76-
/// `memory` or `memory-shared`.
77-
/// 2. `in-memory`
78-
/// 3. `sled://{path}`
79-
#[clap(long, env = "RW_STATE_STORE")]
80-
pub state_store: Option<String>,
81-
8273
/// The path of `risingwave.toml` configuration file.
8374
///
8475
/// If empty, default configuration values will be used.
@@ -173,7 +164,6 @@ pub fn start(opts: ComputeNodeOpts) -> Pin<Box<dyn Future<Output = ()> + Send>>
173164
// slow compile in release mode.
174165
Box::pin(async move {
175166
tracing::info!("options: {:?}", opts);
176-
warn_future_deprecate_options(&opts);
177167
validate_opts(&opts);
178168

179169
let listen_addr = opts.listen_addr.parse().unwrap();
@@ -206,9 +196,3 @@ fn default_total_memory_bytes() -> usize {
206196
fn default_parallelism() -> usize {
207197
total_cpu_available().ceil() as usize
208198
}
209-
210-
fn warn_future_deprecate_options(opts: &ComputeNodeOpts) {
211-
if opts.state_store.is_some() {
212-
tracing::warn!("`--state-store` will not be accepted by compute node in the next release. Please consider moving this argument to the meta node.");
213-
}
214-
}

src/compute/src/server.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,10 @@ pub async fn compute_node_serve(
108108
.unwrap();
109109
let storage_opts = Arc::new(StorageOpts::from((&config, &system_params)));
110110

111-
let state_store_url = {
112-
let from_local = opts
113-
.state_store
114-
.clone()
115-
.unwrap_or_else(|| "hummock+memory".to_string());
116-
system_params.state_store(from_local)
117-
};
111+
let state_store_url = system_params.state_store();
118112

119113
let embedded_compactor_enabled =
120-
embedded_compactor_enabled(&state_store_url, config.storage.disable_remote_compactor);
114+
embedded_compactor_enabled(state_store_url, config.storage.disable_remote_compactor);
121115
let storage_memory_bytes =
122116
total_storage_memory_limit_bytes(&config.storage, embedded_compactor_enabled);
123117
let compute_memory_bytes =
@@ -152,7 +146,7 @@ pub async fn compute_node_serve(
152146
let mut join_handle_vec = vec![];
153147

154148
let state_store = StateStoreImpl::new(
155-
&state_store_url,
149+
state_store_url,
156150
storage_opts.clone(),
157151
hummock_meta_client.clone(),
158152
state_store_metrics.clone(),

src/risedevtool/src/compose.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,7 @@ fn health_check_port(port: u16) -> HealthCheck {
154154
impl Compose for ComputeNodeConfig {
155155
fn compose(&self, config: &ComposeConfig) -> Result<ComposeService> {
156156
let mut command = Command::new("compute-node");
157-
ComputeNodeService::apply_command_args(
158-
&mut command,
159-
self,
160-
HummockInMemoryStrategy::Disallowed,
161-
)?;
157+
ComputeNodeService::apply_command_args(&mut command, self)?;
162158
if self.enable_tiered_cache {
163159
command.arg("--file-cache-dir").arg("/filecache");
164160
}
@@ -201,7 +197,11 @@ impl Compose for ComputeNodeConfig {
201197
impl Compose for MetaNodeConfig {
202198
fn compose(&self, config: &ComposeConfig) -> Result<ComposeService> {
203199
let mut command = Command::new("meta-node");
204-
MetaNodeService::apply_command_args(&mut command, self)?;
200+
MetaNodeService::apply_command_args(
201+
&mut command,
202+
self,
203+
HummockInMemoryStrategy::Disallowed,
204+
)?;
205205

206206
if let Some(c) = &config.rw_config_path {
207207
let target = Path::new(&config.config_directory).join("risingwave.toml");
@@ -264,11 +264,7 @@ impl Compose for FrontendConfig {
264264
impl Compose for CompactorConfig {
265265
fn compose(&self, config: &ComposeConfig) -> Result<ComposeService> {
266266
let mut command = Command::new("compactor-node");
267-
CompactorService::apply_command_args(
268-
&mut command,
269-
self,
270-
HummockInMemoryStrategy::Disallowed,
271-
)?;
267+
CompactorService::apply_command_args(&mut command, self)?;
272268

273269
if let Some(c) = &config.rw_config_path {
274270
let target = Path::new(&config.config_directory).join("risingwave.toml");

src/risedevtool/src/service_config.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ pub struct ComputeNodeConfig {
3636
pub provide_opendal: Option<Vec<OpendalConfig>>,
3737
pub provide_aws_s3: Option<Vec<AwsS3Config>>,
3838
pub provide_jaeger: Option<Vec<JaegerConfig>>,
39-
pub provide_compactor: Option<Vec<CompactorConfig>>,
4039
pub user_managed: bool,
41-
pub enable_in_memory_kv_state_backend: bool,
4240
pub connector_rpc_endpoint: String,
4341

4442
pub total_memory_bytes: usize,
@@ -67,6 +65,14 @@ pub struct MetaNodeConfig {
6765
pub connector_rpc_endpoint: String,
6866
pub provide_etcd_backend: Option<Vec<EtcdConfig>>,
6967
pub provide_prometheus: Option<Vec<PrometheusConfig>>,
68+
69+
pub provide_compute_node: Option<Vec<ComputeNodeConfig>>,
70+
pub provide_compactor: Option<Vec<CompactorConfig>>,
71+
72+
pub provide_aws_s3: Option<Vec<AwsS3Config>>,
73+
pub provide_minio: Option<Vec<MinioConfig>>,
74+
pub provide_opendal: Option<Vec<OpendalConfig>>,
75+
pub enable_in_memory_kv_state_backend: bool,
7076
}
7177

7278
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
@@ -103,8 +109,6 @@ pub struct CompactorConfig {
103109
pub exporter_port: u16,
104110

105111
pub provide_minio: Option<Vec<MinioConfig>>,
106-
pub provide_opendal: Option<Vec<OpendalConfig>>,
107-
pub provide_aws_s3: Option<Vec<AwsS3Config>>,
108112

109113
pub provide_meta_node: Option<Vec<MetaNodeConfig>>,
110114
pub user_managed: bool,

src/risedevtool/src/task/compactor_service.rs

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,10 @@ use std::io::Write;
1717
use std::path::Path;
1818
use std::process::Command;
1919

20-
use anyhow::{anyhow, Result};
20+
use anyhow::Result;
2121

2222
use crate::util::{get_program_args, get_program_env_cmd, get_program_name};
23-
use crate::{
24-
add_meta_node, add_storage_backend, CompactorConfig, ExecuteContext, HummockInMemoryStrategy,
25-
Task,
26-
};
23+
use crate::{add_meta_node, CompactorConfig, ExecuteContext, Task};
2724

2825
pub struct CompactorService {
2926
config: CompactorConfig,
@@ -45,19 +42,7 @@ impl CompactorService {
4542
}
4643

4744
/// Apply command args according to config
48-
pub fn apply_command_args(
49-
cmd: &mut Command,
50-
config: &CompactorConfig,
51-
hummock_in_memory_strategy: HummockInMemoryStrategy,
52-
) -> Result<()> {
53-
if matches!(
54-
hummock_in_memory_strategy,
55-
HummockInMemoryStrategy::Isolated
56-
) {
57-
return Err(anyhow!(
58-
"compactor cannot use in-memory hummock if remote object store is not provided"
59-
));
60-
}
45+
pub fn apply_command_args(cmd: &mut Command, config: &CompactorConfig) -> Result<()> {
6146
cmd.arg("--listen-addr")
6247
.arg(format!("{}:{}", config.listen_address, config.port))
6348
.arg("--prometheus-listener-addr")
@@ -78,18 +63,6 @@ impl CompactorService {
7863
.arg(format!("{}", compaction_worker_threads_number));
7964
}
8065

81-
let provide_minio = config.provide_minio.as_ref().unwrap();
82-
let provide_aws_s3 = config.provide_aws_s3.as_ref().unwrap();
83-
let provide_opendal = config.provide_opendal.as_ref().unwrap();
84-
add_storage_backend(
85-
&config.id,
86-
provide_opendal,
87-
provide_minio,
88-
provide_aws_s3,
89-
hummock_in_memory_strategy,
90-
cmd,
91-
)?;
92-
9366
let provide_meta_node = config.provide_meta_node.as_ref().unwrap();
9467
add_meta_node(provide_meta_node, cmd)?;
9568

@@ -124,7 +97,7 @@ impl Task for CompactorService {
12497

12598
cmd.arg("--config-path")
12699
.arg(Path::new(&prefix_config).join("risingwave.toml"));
127-
Self::apply_command_args(&mut cmd, &self.config, HummockInMemoryStrategy::Disallowed)?;
100+
Self::apply_command_args(&mut cmd, &self.config)?;
128101

129102
if !self.config.user_managed {
130103
ctx.run_command(ctx.tmux_run(cmd)?)?;

0 commit comments

Comments
 (0)