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

[#719] feat(netty): Optimize allocation strategy #739

Merged
merged 6 commits into from
Mar 20, 2023

Conversation

smallzhongfeng
Copy link
Contributor

What changes were proposed in this pull request?

Users can choose to use netty's transmission method or grpc's through client configuration.

Why are the changes needed?

Fix: #719

Does this PR introduce any user-facing change?

No. However, if users want to use netty as a data transfer method, they need to enable spark.rss.client.type=GRPC_ NETTY or mapreduce.rss.client.type=GRPC_ NETTY

How was this patch tested?

New uts.

@codecov-commenter
Copy link

codecov-commenter commented Mar 18, 2023

Codecov Report

Merging #739 (6828c0b) into master (d82e10d) will increase coverage by 2.07%.
The diff coverage is 69.23%.

@@             Coverage Diff              @@
##             master     #739      +/-   ##
============================================
+ Coverage     60.73%   62.81%   +2.07%     
- Complexity     1859     1898      +39     
============================================
  Files           231      224       -7     
  Lines         12857    11049    -1808     
  Branches       1071     1091      +20     
============================================
- Hits           7809     6940     -869     
+ Misses         4633     3732     -901     
+ Partials        415      377      -38     
Impacted Files Coverage Δ
...apache/hadoop/mapreduce/v2/app/RssMRAppMaster.java 0.00% <0.00%> (ø)
...java/org/apache/uniffle/common/config/RssConf.java 32.19% <0.00%> (-0.23%) ⬇️
...va/org/apache/uniffle/client/util/ClientUtils.java 56.25% <100.00%> (+3.97%) ⬆️
.../java/org/apache/uniffle/server/ShuffleServer.java 64.84% <100.00%> (+0.82%) ⬆️

... and 23 files with indirect coverage changes

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

CoordinatorTestUtils.waitForRegister(coordinatorClient,2);
// When the shuffleServerHeartbeat Test is completed before the current test,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

shuffleServerConf.setInteger(ShuffleServerConf.NETTY_SERVER_PORT, SHUFFLE_SERVER_PORT + 5);

Because this shuffleServerConf modifies the netty port number of a server, there will be one less machine allocated. Therefore, in order to maintain the original test, we need to set the port number back to a negative number, which is equivalent to setting the label to GRPC.

@@ -130,6 +131,11 @@ public static void main(String[] args) {
assignmentTags.addAll(Arrays.asList(rawTags.split(",")));
}
assignmentTags.add(Constants.SHUFFLE_SERVER_VERSION);
if (ClientType.GRPC_NETTY.name().equals(conf.get(RssMRConfig.RSS_CLIENT_TYPE))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we also add a conf validator for RSS_CLIENT_TYPE here?

Then I think we can simply call assignmentTags.add(conf.get(RssMRConfig.RSS_CLIENT_TYPE)) here?

@@ -122,4 +126,11 @@ public static void validateTestModeConf(boolean testMode, String storageType) {
+ "because of the poor performance of these two types.");
}
}

public static void validateClientType(String clientType) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we convert this method to CheckValue#checkValueFunc like ConfigUtil#POSITIVE_LONG_VALIDATOR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, i will try it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't seem to work because there is no checkValue on mr's client side.

Copy link
Contributor

Choose a reason for hiding this comment

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

I got it. My mistake.

Field field = clazz.getDeclaredField("settings");
field.setAccessible(true);
originConf.remove(ShuffleServerConf.NETTY_SERVER_PORT.key());
field.set(shuffleServerConf, originConf);
Copy link
Contributor

@jerqi jerqi Mar 20, 2023

Choose a reason for hiding this comment

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

We don't need set the value again. They are the same object.

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 got it.

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.

@jerqi jerqi merged commit 2cb22ff into apache:master Mar 20, 2023
@smallzhongfeng
Copy link
Contributor Author

Thanks for your review! @jerqi @advancedxy

advancedxy pushed a commit to advancedxy/incubator-uniffle that referenced this pull request Mar 21, 2023
### What changes were proposed in this pull request?
Users can choose to use netty's transmission method or grpc's through client configuration.

### Why are the changes needed?
Fix: apache#719 

### Does this PR introduce _any_ user-facing change?
No. However, if users want to use `netty` as a data transfer method, they need to enable `spark.rss.client.type=GRPC_ NETTY` or `mapreduce.rss.client.type=GRPC_ NETTY`

### How was this patch tested?
New uts.
xianjingfeng pushed a commit to xianjingfeng/incubator-uniffle that referenced this pull request Apr 5, 2023
### What changes were proposed in this pull request?
Users can choose to use netty's transmission method or grpc's through client configuration.

### Why are the changes needed?
Fix: apache#719 

### Does this PR introduce _any_ user-facing change?
No. However, if users want to use `netty` as a data transfer method, they need to enable `spark.rss.client.type=GRPC_ NETTY` or `mapreduce.rss.client.type=GRPC_ NETTY`

### How was this patch tested?
New 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.

[Subtask] [Netty] Optimize allocation strategy
4 participants