-
Notifications
You must be signed in to change notification settings - Fork 594
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(storage): refactor compaction event loop #14631
Conversation
…nto li0k/storage_compact_event_loop
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.
What does this PR propose for ?
…nto li0k/storage_compact_event_loop
|
src/meta/src/hummock/manager/mod.rs
Outdated
let mut event_loop_iteration_now = Instant::now(); | ||
loop { | ||
let shutdown_rx_shared = shutdown_rx_shared.clone(); | ||
async fn compact_task_event_handler( |
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.
How about define this method outside
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.
done
…nto li0k/storage_compact_event_loop
…nto li0k/storage_compact_event_loop
…nto li0k/storage_compact_event_loop
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.
LGTM
…nto li0k/storage_compact_event_loop
…nto li0k/storage_compact_event_loop
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.
LGTM
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.
Rest LGTM
let mut compactor_alive = true; | ||
let (context_id, compactor_stream_req) = result; | ||
|
||
let (context_id, compactor_stream_req): (_, (std::option::Option<std::result::Result<SubscribeCompactionEventRequest, _>>, _)) = result; | ||
let (event, create_at, stream) = match compactor_stream_req { | ||
(Some(Ok(req)), stream) => { | ||
(req.event.unwrap(), req.create_at, stream) | ||
} | ||
|
||
(Some(Err(err)), _stream) => { | ||
tracing::warn!(error = %err.as_report(), "compactor {} leaving the cluster with err", context_id); | ||
hummock_manager.compactor_manager | ||
.remove_compactor(context_id); |
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.
why remove this?
|
||
(Some(Err(err)), _stream) => { | ||
tracing::warn!(error = %err.as_report(), "compactor {} leaving the cluster with err", context_id); | ||
hummock_manager.compactor_manager | ||
.remove_compactor(context_id); | ||
tracing::warn!(error = %err.as_report(), "compactor stream {} poll with err, recv stream may be destroyed", context_id); | ||
continue | ||
} | ||
|
||
_ => { | ||
tracing::warn!("compactor {} leaving the cluster", context_id); | ||
hummock_manager.compactor_manager | ||
.remove_compactor(context_id); |
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.
why remove this?
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.
remove_compactor
will remove the tx
via context_id. Therefore, we only remove tx when send fails and rx when recv fails.
In short: avoid having multiple branches operating removing tx
…nto li0k/storage_compact_event_loop
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
9425213 | Triggered | Generic Password | dbc5c52 | ci/scripts/regress-test.sh | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
#13879
Introduce a dedicated loop for CPU-bound / IO-bound events to avoid slow events from occupying the event loop thread for a long time, causing the basic event loop to starve.
Checklist
./risedev check
(or alias,./risedev c
)Documentation
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.