Skip to content

Commit 8261a30

Browse files
authored
fix(risedev): disallow in memory state store when there is a compactor (#8729)
1 parent 9d64e50 commit 8261a30

File tree

2 files changed

+5
-18
lines changed

2 files changed

+5
-18
lines changed

src/risedevtool/src/task/meta_node_service.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,7 @@ impl MetaNodeService {
102102
let provide_aws_s3 = config.provide_aws_s3.as_ref().unwrap();
103103

104104
let provide_compute_node = config.provide_compute_node.as_ref().unwrap();
105-
106-
// If compactors are provided, disable in-memory hummock (unshared).
107-
let hummock_in_memory_strategy = if matches!(
108-
hummock_in_memory_strategy,
109-
HummockInMemoryStrategy::Isolated
110-
) {
111-
HummockInMemoryStrategy::Disallowed
112-
} else {
113-
hummock_in_memory_strategy
114-
};
105+
let provide_compactor = config.provide_compactor.as_ref().unwrap();
115106

116107
let is_shared_backend = match (
117108
config.enable_in_memory_kv_state_backend,
@@ -138,14 +129,14 @@ impl MetaNodeService {
138129
)?,
139130
};
140131

141-
if provide_compute_node.len() > 1 && !is_shared_backend {
132+
if (provide_compute_node.len() > 1 || !provide_compactor.is_empty()) && !is_shared_backend {
142133
if config.enable_in_memory_kv_state_backend {
143134
// Using a non-shared backend with multiple compute nodes will be problematic for
144135
// state sharing like scaling. However, for distributed end-to-end tests with
145136
// in-memory state store, this is acceptable.
146137
} else {
147138
return Err(anyhow!(
148-
"Hummock storage may behave incorrectly with in-memory backend for multiple compute-node configuration. Should use a shared backend (e.g. MinIO) instead. Consider adding `use: minio` in risedev config."
139+
"Hummock storage may behave incorrectly with in-memory backend for multiple compute-node or compactor-enabled configuration. Should use a shared backend (e.g. MinIO) instead. Consider adding `use: minio` in risedev config."
149140
));
150141
}
151142
}

src/risedevtool/src/task/utils.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,35 +101,31 @@ pub fn add_storage_backend(
101101
if opendal.engine == "hdfs"{
102102
cmd.arg("--state-store")
103103
.arg(format!("hummock+hdfs://{}@{}", opendal.namenode, opendal.root));
104-
true
105104
}
106105
else if opendal.engine == "gcs"{
107106
cmd.arg("--state-store")
108107
.arg(format!("hummock+gcs://{}@{}", opendal.bucket, opendal.root));
109-
true}
108+
}
110109
else if opendal.engine == "oss"{
111110
cmd.arg("--state-store")
112111
.arg(format!("hummock+oss://{}@{}", opendal.bucket, opendal.root));
113-
true
114112
}
115113
else if opendal.engine == "webhdfs"{
116114
cmd.arg("--state-store")
117115
.arg(format!("hummock+webhdfs://{}@{}", opendal.namenode, opendal.root));
118-
true
119116
}
120117
else if opendal.engine == "azblob"{
121118
cmd.arg("--state-store")
122119
.arg(format!("hummock+azblob://{}@{}", opendal.bucket, opendal.root));
123-
true
124120
}
125121
else if opendal.engine == "fs"{
126122
cmd.arg("--state-store")
127123
.arg(format!("hummock+fs://{}@{}", opendal.namenode, opendal.root));
128-
true
129124
}
130125
else{
131126
unimplemented!()
132127
}
128+
true
133129
}
134130

135131
(other_minio, other_s3, _) => {

0 commit comments

Comments
 (0)