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

[Improvement] Only report to the shuffle servers that owns the blocks #539

Merged
merged 6 commits into from
Feb 3, 2023

Conversation

zuston
Copy link
Member

@zuston zuston commented Feb 2, 2023

What changes were proposed in this pull request?

Only report to the shuffle servers that owns the blocks

Why are the changes needed?

I found some unnecessary log is shown in the shuffle server's log, like this

[INFO] 2023-02-02 10:59:04,045 Grpc-881 ShuffleServerGrpcService reportShuffleResult - Report 0 blocks as shuffle result for the task of appId[application_1672821343673_3878453_1675303644304], shuffleId[1619], taskAttemptId[1198007]

As shown above, there is no necessary to report 0 blocks to shuffle server for client. Let's remove this logic.

Improvement

  1. for shuffle server, it reduces the log size and make its more clear
  2. for client, it speeds up the client reporting due to avoiding unnecessary rpc request

Does this PR introduce any user-facing change?

No

How was this patch tested?

  1. UTs

@codecov-commenter
Copy link

codecov-commenter commented Feb 2, 2023

Codecov Report

Merging #539 (58ff4d1) into master (2b872da) will decrease coverage by 0.84%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##             master     #539      +/-   ##
============================================
- Coverage     60.25%   59.41%   -0.84%     
- Complexity     1784     1787       +3     
============================================
  Files           205      213       +8     
  Lines         11558    12357     +799     
  Branches       1042     1045       +3     
============================================
+ Hits           6964     7342     +378     
- Misses         4187     4606     +419     
- Partials        407      409       +2     
Impacted Files Coverage Δ
...he/uniffle/client/impl/ShuffleWriteClientImpl.java 34.44% <0.00%> (-0.51%) ⬇️
...a/org/apache/uniffle/common/ShuffleServerInfo.java 75.00% <0.00%> (ø)
...pache/uniffle/server/ShuffleServerGrpcMetrics.java 100.00% <0.00%> (ø)
...fle/coordinator/metric/CoordinatorGrpcMetrics.java 100.00% <0.00%> (ø)
deploy/kubernetes/operator/pkg/utils/rss.go 100.00% <0.00%> (ø)
...pkg/controller/sync/shuffleserver/shuffleserver.go 58.68% <0.00%> (ø)
...eploy/kubernetes/operator/pkg/utils/coordinator.go 0.00% <0.00%> (ø)
deploy/kubernetes/operator/pkg/utils/config.go 0.00% <0.00%> (ø)
deploy/kubernetes/operator/pkg/utils/certs.go 0.00% <0.00%> (ø)
deploy/kubernetes/operator/pkg/utils/util.go 0.00% <0.00%> (ø)
... and 10 more

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

@zuston zuston marked this pull request as draft February 2, 2023 07:50
@zuston zuston marked this pull request as ready for review February 2, 2023 08:34
xianjingfeng
xianjingfeng previously approved these changes Feb 3, 2023
Copy link
Member

@xianjingfeng xianjingfeng left a comment

Choose a reason for hiding this comment

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

LGTM

for (Map.Entry<ShuffleServerInfo, List<Integer>> entry : groupedPartitions.entrySet()) {
Map<Integer, List<Long>> requestBlockIds = Maps.newHashMap();
for (Integer partitionId : entry.getValue()) {
requestBlockIds.put(partitionId, partitionToBlockIds.get(partitionId));
List<Long> partitions = partitionToBlockIds.get(partitionId);
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be blockIds instead of parttions.

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

groupedPartitions.putIfAbsent(ssi, Lists.newArrayList());
}
groupedPartitions.get(ssi).add(entry.getKey());
groupedPartitions.putIfAbsent(ssi, Lists.newArrayList());
Copy link
Member

Choose a reason for hiding this comment

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

Lists.newArrayList() will be invoked everytime.

Copy link
Member Author

Choose a reason for hiding this comment

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

Emm.. Yes, I forget this problem for putIfAbsent

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, the original logic is OK for me. Let me recover this part.

Copy link
Member

@xianjingfeng xianjingfeng left a comment

Choose a reason for hiding this comment

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

LGTM

@zuston zuston merged commit 2b35e80 into apache:master Feb 3, 2023
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.

None yet

4 participants