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

[#133] feat(netty): integration-test supports netty. #1008

Merged
merged 3 commits into from
Jul 25, 2023

Conversation

leixm
Copy link
Contributor

@leixm leixm commented Jul 12, 2023

What changes were proposed in this pull request?

For #133

Why are the changes needed?

Make integration-test support netty.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

UTs.

@@ -252,7 +252,9 @@ public <K, V, C> ShuffleHandle registerShuffle(int shuffleId, int numMaps, Shuff
// get all register info according to coordinator's response
Set<String> assignmentTags = RssSparkShuffleUtils.getAssignmentTags(sparkConf);
ClientUtils.validateClientType(clientType);
assignmentTags.add(clientType);
if (!sparkConf.get(RssSparkConfig.RSS_TEST_MODE_ENABLE)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this? We should reduce similar code. If we don't have better solution, it's acceptable.

@jerqi
Copy link
Contributor

jerqi commented Jul 24, 2023

You can run the command to fix code style issues

mvn spotless:apply -Pspark3 -Pspark2 -Ptez -Pmr -Phadoop2.

@codecov-commenter
Copy link

codecov-commenter commented Jul 24, 2023

Codecov Report

Merging #1008 (c58a624) into master (d0f0b57) will increase coverage by 0.43%.
The diff coverage is 50.00%.

@@             Coverage Diff              @@
##             master    #1008      +/-   ##
============================================
+ Coverage     54.76%   55.19%   +0.43%     
- Complexity     2526     2545      +19     
============================================
  Files           362      362              
  Lines         19334    19377      +43     
  Branches       1799     1803       +4     
============================================
+ Hits          10588    10695     +107     
+ Misses         8116     8055      -61     
+ Partials        630      627       -3     
Impacted Files Coverage Δ
...java/org/apache/uniffle/common/config/RssConf.java 29.86% <0.00%> (-0.43%) ⬇️
...rg/apache/uniffle/common/netty/MessageEncoder.java 64.70% <0.00%> (-4.05%) ⬇️
...e/uniffle/common/netty/client/TransportClient.java 17.46% <0.00%> (ø)
.../apache/uniffle/common/netty/protocol/Message.java 50.81% <ø> (-1.64%) ⬇️
...iffle/client/factory/CoordinatorClientFactory.java 0.00% <0.00%> (ø)
...niffle/server/netty/ShuffleServerNettyHandler.java 1.49% <0.00%> (ø)
...pache/spark/shuffle/writer/WriteBufferManager.java 86.78% <100.00%> (+6.99%) ⬆️
...va/org/apache/uniffle/common/ShuffleBlockInfo.java 97.72% <100.00%> (+0.10%) ⬆️
...apache/uniffle/common/netty/protocol/Encoders.java 84.78% <100.00%> (-0.33%) ⬇️

... and 6 files with indirect coverage changes

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

@@ -105,9 +105,8 @@ public Map runTest(SparkSession spark, String fileName) throws Exception {
map = javaPairRDD.collectAsMap();
shufflePath = appPath + "/1";
assertTrue(new File(shufflePath).exists());
} else {
runCounter++;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When running rssWithNetty, the path with shuffleId=0 has been cleaned up, and an assertion exception will be thrown at this time, assertTrue(fs.exists(new Path(shufflePath)));

Copy link
Contributor

Choose a reason for hiding this comment

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

@zuston Could you take a look at this place?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just keep origin code logic.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK.

@@ -150,4 +152,8 @@ public String toString() {

return sb.toString();
}

public synchronized void copyDataTo(ByteBuf to) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ReplicateWrite would cause concurrency decode, that's why we added synchronized copyDataTo here.

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

@jerqi jerqi merged commit 96eab1c into apache:master Jul 25, 2023
30 checks passed
jerqi pushed a commit that referenced this pull request Feb 26, 2024
### What changes were proposed in this pull request?

Fix [#1008](#1008). It does not actually test `GRPC_NETTY` mode, because it uses `ShuffleServerGrpcClient` everywhere instead of `ShuffleServerGrpcNettyClient`. 
Setting the shuffle server's tags to `GRPC_NETTY,GRPC` is useless, because we are not using `ShuffleServerGrpcNettyClient` at all.

### Why are the changes needed?

It is a sub PR for: #1519
Also, it is a follow-up PR for: #1008

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

No.

### How was this patch tested?

Existing UTs.
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