You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by GitBox <gi...@apache.org> on 2022/11/17 09:45:53 UTC
[GitHub] [incubator-uniffle] xianjingfeng opened a new pull request, #334: [ISSUE-328]Cleanup unused shuffle servers after stage completed
xianjingfeng opened a new pull request, #334:
URL: https://github.com/apache/incubator-uniffle/pull/334
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://github.com/apache/incubator-uniffle/blob/master/CONTRIBUTING.md
2. Ensure you have added or run the appropriate tests for your PR
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]XXXX Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a faster review.
-->
### What changes were proposed in this pull request?
<!--
Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
2. If you fix some SQL features, you can provide some references of other DBMSes.
3. If there is design documentation, please add the link.
4. If there is a discussion in the mailing list, please add the link.
-->
Cleanup unused shuffle servers after stage completed
### Why are the changes needed?
<!--
Please clarify why the changes are needed. For instance,
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
-->
If there are many stages in one applicaiton, spark driver will send heartbeat to every shuffle servers, and it may cause app expired in shuffle server side. And if we support decommission in the future, it will cause shuffle difficult to exit. #328
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to the released versions or within the unreleased branches such as master.
If no, write 'No'.
-->
No
### How was this patch tested?
<!--
If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
If tests were not added, please describe why they were not added and/or why it was difficult to add.
-->
Added
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] codecov-commenter commented on pull request #334: [ISSUE-328]Cleanup unused shuffle servers after stage completed
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #334:
URL: https://github.com/apache/incubator-uniffle/pull/334#issuecomment-1318397529
# [Codecov](https://codecov.io/gh/apache/incubator-uniffle/pull/334?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#334](https://codecov.io/gh/apache/incubator-uniffle/pull/334?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a017a9c) into [master](https://codecov.io/gh/apache/incubator-uniffle/commit/87361da66a467fabbdbecf25061b8e2782c5d9ce?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (87361da) will **increase** coverage by `0.08%`.
> The diff coverage is `71.42%`.
```diff
@@ Coverage Diff @@
## master #334 +/- ##
============================================
+ Coverage 61.21% 61.30% +0.08%
- Complexity 1506 1519 +13
============================================
Files 185 185
Lines 9360 9440 +80
Branches 908 924 +16
============================================
+ Hits 5730 5787 +57
- Misses 3325 3343 +18
- Partials 305 310 +5
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-uniffle/pull/334?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...he/uniffle/client/impl/ShuffleWriteClientImpl.java](https://codecov.io/gh/apache/incubator-uniffle/pull/334/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL2NsaWVudC9pbXBsL1NodWZmbGVXcml0ZUNsaWVudEltcGwuamF2YQ==) | `30.14% <71.42%> (+8.91%)` | :arrow_up: |
| [.../apache/uniffle/common/metrics/MetricsManager.java](https://codecov.io/gh/apache/incubator-uniffle/pull/334/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL2NvbW1vbi9tZXRyaWNzL01ldHJpY3NNYW5hZ2VyLmphdmE=) | `68.42% <0.00%> (-17.30%)` | :arrow_down: |
| [...org/apache/uniffle/common/metrics/GRPCMetrics.java](https://codecov.io/gh/apache/incubator-uniffle/pull/334/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL2NvbW1vbi9tZXRyaWNzL0dSUENNZXRyaWNzLmphdmE=) | `40.00% <0.00%> (-6.52%)` | :arrow_down: |
| [...pache/uniffle/server/ShuffleServerGrpcService.java](https://codecov.io/gh/apache/incubator-uniffle/pull/334/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9TaHVmZmxlU2VydmVyR3JwY1NlcnZpY2UuamF2YQ==) | `0.83% <0.00%> (-0.04%)` | :arrow_down: |
| [...pache/uniffle/server/ShuffleServerGrpcMetrics.java](https://codecov.io/gh/apache/incubator-uniffle/pull/334/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9TaHVmZmxlU2VydmVyR3JwY01ldHJpY3MuamF2YQ==) | `100.00% <0.00%> (ø)` | |
| [.../org/apache/uniffle/server/ShuffleTaskManager.java](https://codecov.io/gh/apache/incubator-uniffle/pull/334/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9TaHVmZmxlVGFza01hbmFnZXIuamF2YQ==) | `77.23% <0.00%> (+0.17%)` | :arrow_up: |
| [...he/uniffle/server/buffer/ShuffleBufferManager.java](https://codecov.io/gh/apache/incubator-uniffle/pull/334/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9idWZmZXIvU2h1ZmZsZUJ1ZmZlck1hbmFnZXIuamF2YQ==) | `82.60% <0.00%> (+0.79%)` | :arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] zuston commented on a diff in pull request #334: [ISSUE-328]Cleanup unused shuffle servers after stage completed
Posted by GitBox <gi...@apache.org>.
zuston commented on code in PR #334:
URL: https://github.com/apache/incubator-uniffle/pull/334#discussion_r1024988638
##########
client/src/main/java/org/apache/uniffle/client/impl/ShuffleWriteClientImpl.java:
##########
@@ -653,9 +666,43 @@ private void throwExceptionIfNecessary(ClientResponse response, String errorMsg)
}
}
+ Set<ShuffleServerInfo> getAllShuffleServers(String appId) {
+ Map<Integer, Set<ShuffleServerInfo>> appServerMap = shuffleServerInfoMap.get(appId);
+ if (appServerMap == null) {
+ return Collections.EMPTY_SET;
+ }
+ Set<ShuffleServerInfo> serverInfos = Sets.newHashSet();
+ appServerMap.values().forEach((serverSet) -> {
+ serverInfos.addAll(serverSet);
+ });
+ return serverInfos;
+ }
+
@VisibleForTesting
public ShuffleServerClient getShuffleServerClient(ShuffleServerInfo shuffleServerInfo) {
return ShuffleServerClientFactory.getInstance().getShuffleServerClient(clientType, shuffleServerInfo);
}
+ @VisibleForTesting
+ void registerShuffleServer(String appId, int shuffleId, ShuffleServerInfo serverInfo) {
+ Map<Integer, Set<ShuffleServerInfo>> appServerMap = shuffleServerInfoMap.get(appId);
+ if (appServerMap == null) {
+ appServerMap = Maps.newConcurrentMap();
+ shuffleServerInfoMap.put(appId, appServerMap);
+ }
+ Set<ShuffleServerInfo> shuffleServerInfos = appServerMap.get(shuffleId);
+ if (shuffleServerInfos == null) {
+ shuffleServerInfos = Sets.newConcurrentHashSet();
+ appServerMap.put(shuffleId, shuffleServerInfos);
+ }
+ shuffleServerInfos.add(serverInfo);
+ }
+
+ @VisibleForTesting
+ void unRegisterShuffleServer(String appId, int shuffleId) {
Review Comment:
`removeShuffleServerInfo` ?
##########
client/src/main/java/org/apache/uniffle/client/impl/ShuffleWriteClientImpl.java:
##########
@@ -350,7 +352,7 @@ public void registerShuffle(
String msg = "Error happened when registerShuffle with appId[" + appId + "], shuffleId[" + shuffleId
+ "], " + shuffleServerInfo;
throwExceptionIfNecessary(response, msg);
- shuffleServerInfoSet.add(shuffleServerInfo);
+ registerShuffleServer(appId, shuffleId, shuffleServerInfo);
Review Comment:
rename to `addShuffleServerInfo` ? The `registerShuffleServer ` in this class looks a RPC method.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] zuston merged pull request #334: [ISSUE-328] Cleanup unused shuffle servers after stage completed
Posted by GitBox <gi...@apache.org>.
zuston merged PR #334:
URL: https://github.com/apache/incubator-uniffle/pull/334
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org