-
Notifications
You must be signed in to change notification settings - Fork 810
fix(batch): mask serving workers with version mismatch #26559
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
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6183095
fix(batch): mask serving workers with version mismatch
zwang28 81873f7
chore: require clippy before PR submission
zwang28 dce1490
Revert "chore: require clippy before PR submission"
zwang28 676f584
fix(batch): address version mask review
zwang28 f8670de
test(frontend): set worker version in scheduler fixtures
zwang28 54f0aa4
revert frontend worker resource update notification
zwang28 c831740
Merge remote-tracking branch 'origin/main' into nukualofa
zwang28 dcf5c5d
fix(test): wait for locality backfill internal tables
zwang28 55a9730
test: add serving mapping start order simulation coverage
zwang28 84ca307
test: verify serving mapping version filtering
zwang28 452b614
test: verify batch task routing in serving mapping tests
zwang28 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| // Copyright 2026 RisingWave Labs | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| use std::collections::HashMap; | ||
| use std::sync::{LazyLock, Mutex}; | ||
|
|
||
| static BATCH_CREATE_TASK_COUNTS: LazyLock<Mutex<HashMap<String, u64>>> = | ||
| LazyLock::new(Default::default); | ||
|
|
||
| pub fn record_create_task() { | ||
| let hostname = risingwave_common::util::resource_util::hostname(); | ||
| *BATCH_CREATE_TASK_COUNTS | ||
| .lock() | ||
| .unwrap() | ||
| .entry(hostname) | ||
| .or_default() += 1; | ||
| } | ||
|
|
||
| pub fn create_task_count(node: &str) -> u64 { | ||
| *BATCH_CREATE_TASK_COUNTS | ||
| .lock() | ||
| .unwrap() | ||
| .get(node) | ||
| .unwrap_or(&0) | ||
| } | ||
|
|
||
| pub fn reset_create_task_counts() { | ||
| BATCH_CREATE_TASK_COUNTS.lock().unwrap().clear(); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Blocking: this fallback now also bypasses the version check. If every serving worker has a different/empty version, or the only matching-version worker is temporarily masked,
all(...)is true and we return the original list, making incompatible workers schedulable again. Please keep version mismatch fail-closed and apply the “all masked” fallback only to the temporary mask within the matching-version subset. Please also cover both cases in tests.Uh oh!
There was an error while loading. Please reload this page.
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.
BTW for a typical serving node (frontend + serving role compute node), at least 1 matched serving node is guaranteed.