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

feat(cmd_all): create directories in single_node mode #15176

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

kwannoel
Copy link
Contributor

@kwannoel kwannoel commented Feb 21, 2024

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Closes #15062

Just create state_store, meta_store directories, if they did not exist.

The default store directory is:

~/.risingwave

So by default, the following directories are created:

noelkwan@Noels-MacBook-Pro risingwave % tree ~/.risingwave 
/Users/noelkwan/.risingwave
├── meta_store
│   └── single_node.db
└── state_store
    └── hummock_001
        ├── checkpoint
        │   └── 0
        └── cluster_id
            └── 0

Checklist

Also separate single_node from standalone_mode.

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@kwannoel kwannoel marked this pull request as ready for review February 21, 2024 08:19
Comment on lines 308 to 309
// wait for log messages to be flushed
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean this?

Suggested change
// wait for log messages to be flushed
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
io::stdout().flush().unwrap();


// TODO: should we join all handles?
// Currently, not all services can be shutdown gracefully, just quit on Ctrl-C now.
// TODO(kwannoel): Why can't be shutdown gracefully? Is it that the service just does not
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried joining all handles after receiving signal::ctrl_c? Does it work? I think it would work 🤔

Copy link
Member

@BugenZhao BugenZhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind filling the PR body to show some backgrounds, and how the directory structure looks like before and after this PR?

let settings = risingwave_rt::LoggerSettings::from_opts(&opts)
.with_target("risingwave_storage", Level::WARN)
.with_thread_name(true);
risingwave_rt::init_risingwave_logger(settings);
risingwave_rt::main_okk(risingwave_cmd_all::standalone(opts)).unwrap();
risingwave_rt::main_okk(risingwave_cmd_all::single_node(opts)).unwrap();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I know the difference between them?

// wait for log messages to be flushed
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
eprintln!("-------------------------------");
eprintln!("RisingWave single_node mode is ready.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
eprintln!("RisingWave single_node mode is ready.");
eprintln!("RisingWave single node mode is ready.");

@kwannoel
Copy link
Contributor Author

Will do the refactor another time. Want to get the single node mode ready first.

@kwannoel
Copy link
Contributor Author

kwannoel commented Feb 21, 2024

Will address the review comments in a separate PR, when I refactor single_node as a separate cmd_all component.

Now this PR only contains changes to create the meta store.

@kwannoel kwannoel changed the title chore(cmd_all): create directories in single node mode. chore(cmd_all): create directories in single node mode Feb 21, 2024
@kwannoel kwannoel changed the title chore(cmd_all): create directories in single node mode chore(cmd_all): create directories in single_node mode Feb 21, 2024
@kwannoel kwannoel force-pushed the kwannoel/create_meta_store_and_state_store branch from 17f6ee4 to 72e2c98 Compare February 21, 2024 09:42
@kwannoel
Copy link
Contributor Author

Bump, PTAL @BugenZhao , @fuyufjh , the refactors have been stripped from this PR. Now we just create store directories.

@fuyufjh fuyufjh changed the title chore(cmd_all): create directories in single_node mode feat(cmd_all): create directories in single_node mode Feb 22, 2024
@kwannoel kwannoel enabled auto-merge February 22, 2024 06:20
auto-merge was automatically disabled February 23, 2024 01:45

Merge queue setting changed

@kwannoel kwannoel force-pushed the kwannoel/create_meta_store_and_state_store branch from 72e2c98 to 0d1606e Compare February 23, 2024 06:36
@kwannoel kwannoel enabled auto-merge February 23, 2024 06:36
@kwannoel kwannoel added this pull request to the merge queue Feb 23, 2024
Merged via the queue into main with commit 6033ee6 Feb 23, 2024
27 of 28 checks passed
@kwannoel kwannoel deleted the kwannoel/create_meta_store_and_state_store branch February 23, 2024 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create directory for meta store path if it does not exist
3 participants