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

[#881] fix: Ensure LocalStorageMeta disk size is correctly updated when events are processed #902

Merged
merged 2 commits into from
May 29, 2023

Conversation

awdavidson
Copy link
Contributor

@awdavidson awdavidson commented May 24, 2023

What changes were proposed in this pull request?

Ensure all events are marked as understorage, this will result to the LocalStorageMeta being updated when events are processed.

Why are the changes needed?

Currently LocalStorageMeta is only update with metrics from the first event in a given shuffleId and partitionId, the first event updates metrics because there is no entry in partitionsOfStorage and the event get marked as underStorage, however, for future events in the same shuffleId and partitionId selectStorage returns the storage and does not mark the event as underStorage so when updateWriteMetrics is called, event.getUnderStorage() returns null and storage.updateWriteMetrics(metrics); is skipped.

As metrics are not updated correctly, LocalStorage.canWrite will not return the correct result.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Added unit test which covers multi events for the same shuffleId and partitionId

@jerqi jerqi linked an issue May 24, 2023 that may be closed by this pull request
3 tasks
@codecov-commenter
Copy link

Codecov Report

Merging #902 (d262b70) into master (3e58805) will increase coverage by 1.84%.
The diff coverage is 66.66%.

@@             Coverage Diff              @@
##             master     #902      +/-   ##
============================================
+ Coverage     55.24%   57.09%   +1.84%     
- Complexity     2201     2202       +1     
============================================
  Files           333      313      -20     
  Lines         16449    14091    -2358     
  Branches       1307     1308       +1     
============================================
- Hits           9087     8045    -1042     
+ Misses         6851     5605    -1246     
+ Partials        511      441      -70     
Impacted Files Coverage Δ
...he/uniffle/server/storage/LocalStorageManager.java 86.85% <66.66%> (+0.72%) ⬆️

... and 21 files with indirect coverage changes

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

@jerqi jerqi requested a review from zuston May 24, 2023 10:46
@jerqi
Copy link
Contributor

jerqi commented May 24, 2023

@zuston Could you review this pr? Because you are more familiar with this part of code.

@zuston
Copy link
Member

zuston commented May 25, 2023

@zuston Could you review this pr? Because you are more familiar with this part of code.

Oh, yes, let me take a look in the next few days

@connorlwilkes
Copy link
Contributor

connorlwilkes commented May 26, 2023

I noticed this whilst benchmarking Uniffle. It makes the settings related to disk capacity almost void and this fix fixed it for me

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, I think we can merge this pr first. @zuston When you have time, you can give another suggestion and raise a follow-up pr. Thanks all.

@jerqi jerqi merged commit 7d25218 into apache:master May 29, 2023
25 checks passed
@jerqi
Copy link
Contributor

jerqi commented May 29, 2023

@awdavidson Could you tell me your company? Do you use Uniffle in your production environment?

@jerqi
Copy link
Contributor

jerqi commented May 29, 2023

@awdavidson There is conflict in the branch 0.7. Could you raise a pr for branch 0.7?

jerqi pushed a commit to jerqi/incubator-uniffle that referenced this pull request Jun 11, 2023
…ted when events are processed (apache#902)

Ensure all events are marked as understorage, this will result to the LocalStorageMeta being updated when events are processed.

Currently LocalStorageMeta is only update with metrics from the first event in a given shuffleId and partitionId, the first event updates metrics because there is no entry in `partitionsOfStorage` and the event get marked as `underStorage`, however, for future events in the same shuffleId and partitionId `selectStorage` returns the storage and does not mark the event as `underStorage` so when `updateWriteMetrics` is called, `event.getUnderStorage()` returns null and `storage.updateWriteMetrics(metrics);` is skipped.

As metrics are not updated correctly, `LocalStorage.canWrite` will not return the correct result.

No.

Added unit test which covers multi events for the same shuffleId and partitionId
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.

[Bug] LocalStorageMeta disk size is not updated for all events
5 participants