-
Notifications
You must be signed in to change notification settings - Fork 591
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(dml): sent dml data from the same session to a fixed worker node/channel #14380
feat(dml): sent dml data from the same session to a fixed worker node/channel #14380
Conversation
… and let group batch perserve transaction order
.get((txn_id % len as u64) as usize) | ||
.get((session_id % len as u32) as usize) |
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.
Use session id instead of txn_id to choose channel so that we can preserve transaction order in the same session
src/frontend/src/scheduler/local.rs
Outdated
candidates.choose(&mut rand::thread_rng()).unwrap().clone() | ||
candidates | ||
.get(stage.session_id.0 as usize % candidates.len()) | ||
.context("no available worker node for dml")? | ||
.clone() |
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.
Choose a worker based on session id.
return Ok(Some( | ||
candidates | ||
.get(self.stage.session_id.0 as usize % candidates.len()) | ||
.context("no available worker node for dml")? | ||
.clone(), |
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.
Choose a worker based on session id.
if !batch_group.is_empty() { | ||
let vec = mem::take(&mut batch_group); | ||
for chunk in vec { | ||
for (op, row) in chunk.rows() { | ||
if let Some(chunk) = builder.append_row(op, row) { | ||
yield Message::Chunk(chunk); | ||
} | ||
} | ||
} | ||
if let Some(chunk) = builder.take() { | ||
yield Message::Chunk(chunk); | ||
} | ||
} |
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.
Always preserve transaction orders even with batch group optimization
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.
Generally 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
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
… and let group batch perserve transaction order
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
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.