-
Notifications
You must be signed in to change notification settings - Fork 168
[Improvement] Ignore partial failure on initializing local storage in shuffle server side #102
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #102 +/- ##
============================================
+ Coverage 56.45% 56.55% +0.09%
- Complexity 1182 1183 +1
============================================
Files 149 149
Lines 8008 8019 +11
Branches 767 767
============================================
+ Hits 4521 4535 +14
+ Misses 3243 3241 -2
+ Partials 244 243 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. |
| assertEquals(2, localStorageManager.getStorages().size()); | ||
| } | ||
|
|
||
| public static class MockedLocalStorageBuilder extends LocalStorage.Builder { |
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.
Could we use a path which don't exist instead of MockedLocalStorageBuilder? Such as we use a path named /xxx/yyy, but /xxx don't exist.
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.
Got it.
But i can't understand why this mockBuilder is not appropriate.
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.
Got it. But i can't understand why this mockBuilder is not appropriate.
The Builder some fields and method become protected. I feel it's not necessary.
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.
If the public modifier is not appropriate, i could change to protected. And provide a method of getBasePath().
What do u think so?
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.
Updated. Remove this class @jerqi
| LOGGER.error("Initializing the storage path of {} failed.", storagePath, exception); | ||
| } | ||
| } | ||
| if (localStorages.size() <= 0) { |
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.
Should we introduce a configOption that if the broken disks are more than the value, the start shuffle will fail to start.
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.
Make sense.
…ng multiple local storage paths in shuffle server client
| } | ||
|
|
||
| localStorages = Arrays.asList(localStorageArray); | ||
| localStorages = Arrays.stream(localStorageArray).filter(Objects::nonNull).collect(Collectors.toList()); |
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.
Fix the bug introduced by #72 .
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.
For #72, it's not a bug.
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.
The localStorageArray maybe exist the null in some index, this will make the localStorages exist the null element when using the Arrays.asList(localStorageArray)
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.
Oh, my fault. Ignore this
| } | ||
|
|
||
| localStorages = Arrays.asList(localStorageArray); | ||
| localStorages = Arrays.stream(localStorageArray).filter(Objects::nonNull).collect(Collectors.toList()); |
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.
For #72, it's not a bug.
| // ignore | ||
| } | ||
| } | ||
| } |
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.
Could you add a new line? Because there are a warning if we don't have a newline at the end of the file
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.
Done.
jerqi
left a comment
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
What changes were proposed in this pull request?
Ignore partial failure on initializing local storage in shuffle server side
Why are the changes needed?
When setting multiple storage paths, only one disk is insufficient capacity, shuffle server will directly throw exception. We hope it can be ignored, because bad disks are more common in production environments
Does this PR introduce any user-facing change?
No
How was this patch tested?
UT