-
Notifications
You must be signed in to change notification settings - Fork 198
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
Make fetch shuffle partition data in parallel #256
Conversation
Hi @andygrove, @thinkharderdev, @avantgardnerio, could you help review this PR? |
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.
One question but otherwise LGTM
let mut partition_locations: Vec<PartitionLocation> = partition_locations | ||
.into_values() | ||
.flat_map(|ps| ps.into_iter().enumerate()) | ||
.sorted_by(|(p1_idx, _), (p2_idx, _)| Ord::cmp(p1_idx, p2_idx)) | ||
.map(|(_, p)| p) | ||
.collect(); | ||
// Shuffle partitions for evenly send fetching partition requests to avoid hot executors within multiple tasks | ||
partition_locations.shuffle(&mut thread_rng()); |
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 do we sort by index before shuffling here?
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.
Sorting first may be helpful for reducing the bias of random chosen. Maybe it's not necessary.
// TODO make the maximum size configurable, or make it depends on global memory control | ||
let max_request_num = 50usize; |
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.
+1 for making this a config option that is documented in the user guide. I can help with this in a follow-on PR.
.try_flatten() | ||
}); | ||
let task_id = context.task_id().unwrap_or_else(|| partition.to_string()); | ||
info!("ShuffleReaderExec::execute({})", task_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.
This could make the logs quite noisy again?
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. Thanks @yahoNanJing!
@yahoNanJing Could you please explain a little about the error handling case ? |
@mingmwang Just added one commit to abort fast when error occurs. |
Which issue does this PR close?
Closes #208.
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?