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

[MINOR] fix: Fix LocalStorageManager divide by zero exception #900

Merged
merged 1 commit into from
May 23, 2023

Conversation

leixm
Copy link
Contributor

@leixm leixm commented May 23, 2023

What changes were proposed in this pull request?

Fix LocalStorageManager divide by zero exception when all local disks corrupted.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

UT.

@codecov-commenter
Copy link

codecov-commenter commented May 23, 2023

Codecov Report

Merging #900 (0e2e0ce) into master (9c62784) will increase coverage by 1.86%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master     #900      +/-   ##
============================================
+ Coverage     55.22%   57.08%   +1.86%     
- Complexity     2197     2201       +4     
============================================
  Files           333      313      -20     
  Lines         16444    14089    -2355     
  Branches       1306     1307       +1     
============================================
- Hits           9081     8043    -1038     
+ Misses         6851     5606    -1245     
+ Partials        512      440      -72     
Impacted Files Coverage Δ
...he/uniffle/server/storage/LocalStorageManager.java 86.12% <100.00%> (+0.16%) ⬆️

... and 25 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@leixm
Copy link
Contributor Author

leixm commented May 23, 2023

Flaky test.

@leixm
Copy link
Contributor Author

leixm commented May 23, 2023

cc @jerqi PTAL.

@leixm
Copy link
Contributor Author

leixm commented May 23, 2023

LocalStorageManager#selectStorage -> ShuffleStorageUtils#getStorageIndex int index = MurmurHash.getInstance().hash(hash.getBytes(StandardCharsets.UTF_8)) % max would throws exception when all local disks corrupted.

@jerqi jerqi changed the title Fix LocalStorageManager divide by zero exception [MINOR] fix: Fix LocalStorageManager divide by zero exception May 23, 2023
Copy link
Contributor

@jerqi jerqi left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @leixm , merged to master & 0.7

@jerqi jerqi merged commit e6f8fcb into apache:master May 23, 2023
jerqi pushed a commit that referenced this pull request May 23, 2023
### What changes were proposed in this pull request?

Fix LocalStorageManager divide by zero exception when all local disks corrupted.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

UT.

Co-authored-by: leixianming <leixianming@didiglobal.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants