Skip to content

Commit

Permalink
fix(risedev): disallow in memory state store when there is a compactor (
Browse files Browse the repository at this point in the history
  • Loading branch information
Gun9niR authored Mar 23, 2023
1 parent 9d64e50 commit 8261a30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
15 changes: 3 additions & 12 deletions src/risedevtool/src/task/meta_node_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,7 @@ impl MetaNodeService {
let provide_aws_s3 = config.provide_aws_s3.as_ref().unwrap();

let provide_compute_node = config.provide_compute_node.as_ref().unwrap();

// If compactors are provided, disable in-memory hummock (unshared).
let hummock_in_memory_strategy = if matches!(
hummock_in_memory_strategy,
HummockInMemoryStrategy::Isolated
) {
HummockInMemoryStrategy::Disallowed
} else {
hummock_in_memory_strategy
};
let provide_compactor = config.provide_compactor.as_ref().unwrap();

let is_shared_backend = match (
config.enable_in_memory_kv_state_backend,
Expand All @@ -138,14 +129,14 @@ impl MetaNodeService {
)?,
};

if provide_compute_node.len() > 1 && !is_shared_backend {
if (provide_compute_node.len() > 1 || !provide_compactor.is_empty()) && !is_shared_backend {
if config.enable_in_memory_kv_state_backend {
// Using a non-shared backend with multiple compute nodes will be problematic for
// state sharing like scaling. However, for distributed end-to-end tests with
// in-memory state store, this is acceptable.
} else {
return Err(anyhow!(
"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."
"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."
));
}
}
Expand Down
8 changes: 2 additions & 6 deletions src/risedevtool/src/task/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,35 +101,31 @@ pub fn add_storage_backend(
if opendal.engine == "hdfs"{
cmd.arg("--state-store")
.arg(format!("hummock+hdfs://{}@{}", opendal.namenode, opendal.root));
true
}
else if opendal.engine == "gcs"{
cmd.arg("--state-store")
.arg(format!("hummock+gcs://{}@{}", opendal.bucket, opendal.root));
true}
}
else if opendal.engine == "oss"{
cmd.arg("--state-store")
.arg(format!("hummock+oss://{}@{}", opendal.bucket, opendal.root));
true
}
else if opendal.engine == "webhdfs"{
cmd.arg("--state-store")
.arg(format!("hummock+webhdfs://{}@{}", opendal.namenode, opendal.root));
true
}
else if opendal.engine == "azblob"{
cmd.arg("--state-store")
.arg(format!("hummock+azblob://{}@{}", opendal.bucket, opendal.root));
true
}
else if opendal.engine == "fs"{
cmd.arg("--state-store")
.arg(format!("hummock+fs://{}@{}", opendal.namenode, opendal.root));
true
}
else{
unimplemented!()
}
true
}

(other_minio, other_s3, _) => {
Expand Down

0 comments on commit 8261a30

Please sign in to comment.