Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(meta): split meta into smaller crates (step 1) #12924

Merged
merged 9 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
152 changes: 149 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ members = [
"src/cmd_all",
"src/common",
"src/common/common_service",
"src/common/heap_profiling",
"src/compute",
"src/connector",
"src/ctl",
Expand All @@ -18,6 +19,8 @@ members = [
"src/java_binding",
"src/jni_core",
"src/meta",
"src/meta/node",
"src/meta/service",
"src/meta/src/model_v2/migration",
"src/object_store",
"src/prost",
Expand Down Expand Up @@ -139,6 +142,8 @@ risingwave_hummock_sdk = { path = "./src/storage/hummock_sdk" }
risingwave_hummock_test = { path = "./src/storage/hummock_test" }
risingwave_hummock_trace = { path = "./src/storage/hummock_trace" }
risingwave_meta = { path = "./src/meta" }
risingwave_meta_service = { path = "./src/meta/service" }
risingwave_meta_node = { path = "./src/meta/node" }
risingwave_object_store = { path = "./src/object_store" }
risingwave_pb = { path = "./src/prost" }
risingwave_rpc_client = { path = "./src/rpc_client" }
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ risingwave_compute = { workspace = true }
risingwave_ctl = { workspace = true }
risingwave_expr_impl = { workspace = true }
risingwave_frontend = { workspace = true }
risingwave_meta = { workspace = true }
risingwave_meta_node = { workspace = true }
risingwave_rt = { workspace = true }
tikv-jemallocator = { workspace = true, features = [
"unprefixed_malloc_on_supported_platforms",
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use risingwave_compactor::CompactorOpts;
use risingwave_compute::ComputeNodeOpts;
use risingwave_ctl::CliOpts as CtlOpts;
use risingwave_frontend::FrontendOpts;
use risingwave_meta::MetaNodeOpts;
use risingwave_meta_node::MetaNodeOpts;
use risingwave_rt::{init_risingwave_logger, main_okk, LoggerSettings};

/// Define the `main` function for a component.
Expand Down Expand Up @@ -48,7 +48,7 @@ pub fn compute(opts: ComputeNodeOpts) {

pub fn meta(opts: MetaNodeOpts) {
init_risingwave_logger(LoggerSettings::new("meta"));
main_okk(risingwave_meta::start(opts));
main_okk(risingwave_meta_node::start(opts));
}

pub fn frontend(opts: FrontendOpts) {
Expand Down
2 changes: 1 addition & 1 deletion src/cmd_all/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ risingwave_compute = { workspace = true }
risingwave_ctl = { workspace = true }
risingwave_expr_impl = { workspace = true }
risingwave_frontend = { workspace = true }
risingwave_meta = { workspace = true }
risingwave_meta_node = { workspace = true }
risingwave_rt = { workspace = true }
shell-words = "1.1.0"
strum = "0.25"
Expand Down
2 changes: 1 addition & 1 deletion src/cmd_all/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ You may run and reference the [demo script](../scripts/e2e-full-standalone-demo.

Standalone mode simply passes the options to the corresponding node, and starts them in the same process.

For example `--meta-opts` is parsed, and then Meta Node's entrypoint, `risingwave_meta::start`, is called with the parsed options.
For example `--meta-opts` is parsed, and then Meta Node's entrypoint, `risingwave_meta_node::start`, is called with the parsed options.
If any option is missing, the corresponding node will not be started.
2 changes: 1 addition & 1 deletion src/cmd_all/src/bin/risingwave.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use risingwave_compactor::CompactorOpts;
use risingwave_compute::ComputeNodeOpts;
use risingwave_ctl::CliOpts as CtlOpts;
use risingwave_frontend::FrontendOpts;
use risingwave_meta::MetaNodeOpts;
use risingwave_meta_node::MetaNodeOpts;
use strum::IntoEnumIterator;
use strum_macros::{Display, EnumIter, EnumString, IntoStaticStr};
use tracing::Level;
Expand Down
4 changes: 2 additions & 2 deletions src/cmd_all/src/playground.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ pub async fn playground(opts: PlaygroundOpts) -> Result<()> {
RisingWaveService::Meta(mut opts) => {
opts.insert(0, "meta-node".into());
tracing::info!("starting meta-node thread with cli args: {:?}", opts);
let opts = risingwave_meta::MetaNodeOpts::parse_from(opts);
let opts = risingwave_meta_node::MetaNodeOpts::parse_from(opts);
let _meta_handle = tokio::spawn(async move {
risingwave_meta::start(opts).await;
risingwave_meta_node::start(opts).await;
tracing::warn!("meta is stopped, shutdown all nodes");
// As a playground, it's fine to just kill everything.
if idle_exit {
Expand Down
4 changes: 2 additions & 2 deletions src/cmd_all/src/standalone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use clap::Parser;
use risingwave_compactor::CompactorOpts;
use risingwave_compute::ComputeNodeOpts;
use risingwave_frontend::FrontendOpts;
use risingwave_meta::MetaNodeOpts;
use risingwave_meta_node::MetaNodeOpts;
use shell_words::split;
use tokio::signal;

Expand Down Expand Up @@ -142,7 +142,7 @@ pub async fn standalone(opts: StandaloneOpts) -> Result<()> {
tracing::info!("starting meta-node thread with cli args: {:?}", opts);

let _meta_handle = tokio::spawn(async move {
risingwave_meta::start(opts).await;
risingwave_meta_node::start(opts).await;
tracing::warn!("meta is stopped, shutdown all nodes");
});
// wait for the service to be ready
Expand Down
10 changes: 5 additions & 5 deletions src/common/heap_profiling/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ ignored = ["workspace-hack"]
normal = ["workspace-hack"]

[dependencies]
tikv-jemalloc-ctl = { workspace = true }
risingwave_common = {workspace =true}
tokio = { version = "0.2", package = "madsim-tokio" }
tracing = "0.1"
anyhow = "1"
chrono = { version = "0.4", default-features = false, features = [
"clock",
"std",
] }
anyhow = "1"
parking_lot = "0.12"
risingwave_common = { workspace = true }
tikv-jemalloc-ctl = { workspace = true }
tokio = { version = "0.2", package = "madsim-tokio" }
tracing = "0.1"

[lints]
workspace = true
Loading
Loading