-
Notifications
You must be signed in to change notification settings - Fork 722
feat(session-config): introduce entry-level pure in-memory set configuration #1714
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
Conversation
5af2d5b to
bedf275
Compare
2498747 to
f10efc8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work! cc @liurenjie1024 PTAL 😍
f10efc8 to
640c06e
Compare
Codecov Report
@@ Coverage Diff @@
## main #1714 +/- ##
==========================================
- Coverage 71.17% 71.14% -0.03%
==========================================
Files 600 601 +1
Lines 77743 77795 +52
==========================================
+ Hits 55333 55347 +14
- Misses 22410 22448 +38
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
4515896 to
ded75a1
Compare
src/frontend/src/session.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to be an enum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think twice and I still suggest not do this now. If we change to enum or introduce registry, it might be hard to design a good API (I guess have to use generics). May add a lot of efforts on this PR. For now, we'd better not bothering too much on user's invalid input and redcue the complexity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
src/frontend/src/session.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need a registry to ban invalid config.
ded75a1 to
73eb6da
Compare
73eb6da to
14261dc
Compare
What's changed and what's your intention?
Note this is just a simple beginning of support set comand. There are still a lot of todos: better config init policy, how to handle system level config/consistency of change config, how to persist config, better API design (Builder code patterns or possible generic to make the code pretty). I'd like to distribute the tasks to anyone who are interested in the project. Java's design looks good:
https://github.com/singularity-data/risingwave/blob/8a7c9718dc97eaaede84c1be5a107944a69835e1/legacy/common/src/main/java/com/risingwave/common/config/ConfigEntry.java#L11-L27
But I do not found properly crates to help me and a little overdesign (This part of java code is hard to translate to Rust), so I leave it simple.
The main goal is to remove annoying RW_IMPLICIT_FLUSH in start risedev. Design a
RwLock<HashMap<String, ConfigEntry>>(RwLook from parking_lot, not sure whether it is good, needs investigate) to store config flags, now all type of config values are stored as Stirng (e.g. "1", "true", "on"). For init, we will constructthe map manually inbuild_config_map().Checklist
Refer to a related PR or issue link (optional)