Skip to content
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

[BUG] Fix bug with merge tasks that allows for tasks larger than max size allowed #1882

Merged
merged 4 commits into from
Feb 14, 2024

Conversation

samster25
Copy link
Member

@samster25 samster25 commented Feb 14, 2024

image

@github-actions github-actions bot added the bug Something isn't working label Feb 14, 2024
Copy link

codecov bot commented Feb 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (195174c) 85.55% compared to head (e1106d6) 85.50%.
Report is 1 commits behind head on main.

❗ Current head e1106d6 differs from pull request most recent head fc9b5be. Consider uploading reports for the commit fc9b5be to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1882      +/-   ##
==========================================
- Coverage   85.55%   85.50%   -0.05%     
==========================================
  Files          55       55              
  Lines        6194     6194              
==========================================
- Hits         5299     5296       -3     
- Misses        895      898       +3     

see 2 files with indirect coverage changes

Copy link
Contributor

@jaychia jaychia left a comment

Choose a reason for hiding this comment

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

Mostly LGTM, had some questions about the logic of self.accumulator_ready()

@@ -45,74 +45,71 @@ struct MergeByFileSize {
accumulator: Option<ScanTaskRef>,
}

impl MergeByFileSize {
fn accumulator_ready(&self) -> bool {
if self.accumulator.is_none() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is a None accumulator considered ready?

In the main loop logic, ready accumulators are naively yielded. Should the accumulator_ready function instead yield true only for these:

  1. It is Some, and has no size (we won't be merging this anyways, might as well say its ready to yield)
  2. It is Some, has a size, and the size is smaller than min

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@samster25 samster25 enabled auto-merge (squash) February 14, 2024 19:31
@samster25 samster25 merged commit 74591c1 into main Feb 14, 2024
40 checks passed
@samster25 samster25 deleted the sammy/fix-merge-task-bug branch February 14, 2024 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants