Skip to content

Conversation

@BowenXiao1999
Copy link
Contributor

@BowenXiao1999 BowenXiao1999 commented Apr 8, 2022

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 in build_config_map().

Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests

Refer to a related PR or issue link (optional)

@github-actions github-actions bot added the type/feature Type: New feature. label Apr 8, 2022
@BowenXiao1999 BowenXiao1999 changed the title feat(session-config): introduce set configuration feat(session-config): introduce entry-level pure in-memory set configuration Apr 8, 2022
@BowenXiao1999 BowenXiao1999 force-pushed the bw/add-session-flag branch 2 times, most recently from 2498747 to f10efc8 Compare April 8, 2022 10:29
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.

Good work! cc @liurenjie1024 PTAL 😍

@CLAassistant
Copy link

CLAassistant commented Apr 8, 2022

CLA assistant check
All committers have signed the CLA.

@BowenXiao1999 BowenXiao1999 enabled auto-merge (squash) April 11, 2022 05:55
@codecov
Copy link

codecov bot commented Apr 11, 2022

Codecov Report

Merging #1714 (14261dc) into main (2aa7c54) will decrease coverage by 0.02%.
The diff coverage is 31.57%.

@@            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     
Flag Coverage Δ
rust 71.14% <31.57%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/frontend/src/handler/mod.rs 37.50% <0.00%> (-3.05%) ⬇️
src/frontend/src/handler/query.rs 0.00% <0.00%> (ø)
src/frontend/src/handler/query_single.rs 0.00% <0.00%> (ø)
src/frontend/src/handler/set.rs 0.00% <0.00%> (ø)
src/frontend/src/session.rs 46.12% <58.06%> (+1.56%) ⬆️
src/connector/src/filesystem/file_common.rs 80.35% <0.00%> (-0.45%) ⬇️
.../src/executor/managed_state/aggregation/extreme.rs 90.13% <0.00%> (-0.28%) ⬇️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

liurenjie1024
liurenjie1024 previously approved these changes Apr 11, 2022
Copy link
Contributor

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.

Copy link
Contributor Author

@BowenXiao1999 BowenXiao1999 Apr 11, 2022

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it.

Copy link
Contributor

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.

@liurenjie1024 liurenjie1024 dismissed their stale review April 11, 2022 06:50

Withdraw approve.

@BowenXiao1999 BowenXiao1999 merged commit 4d5b619 into main Apr 11, 2022
@BowenXiao1999 BowenXiao1999 deleted the bw/add-session-flag branch April 11, 2022 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/feature Type: New feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants