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

[ISSUE-285][Improvement] Only use HDFS and LOCALFILE storageType in the test #360

Merged
merged 7 commits into from
Nov 29, 2022

Conversation

tiantingting5435
Copy link
Contributor

@tiantingting5435 tiantingting5435 commented Nov 26, 2022

What changes were proposed in this pull request?

We add some config options:

  1. rss.test.mode.enable, for rss server;

  2. mapreduce.rss.test.mode.enable, for mr client;

  3. spark.rss.test.mode.enable, for spark client.

When we use HDFS or LOCALFILE storageType in the client or shuffle server, we should throw an exception if run with test mode.

Why are the changes needed?

HDFS and LOCALFILE storageType have poor performance, but they are useful for tests. We don't recommend to use them.

Does this PR introduce any user-facing change?

NO

How was this patch tested?

Test locally

@jerqi
Copy link
Contributor

jerqi commented Nov 27, 2022

We should also check client's storageType

String storageType = sparkConf.get(RssSparkConfig.RSS_STORAGE_TYPE.key());

String storageType = sparkConf.get(RssSparkConfig.RSS_STORAGE_TYPE.key());

String storageType = RssMRUtils.getString(extraConf, conf, RssMRConfig.RSS_STORAGE_TYPE);

@jerqi
Copy link
Contributor

jerqi commented Nov 27, 2022

You should fix the code style issue
企业微信截图_1dbe8672-5513-4309-9644-73c5900d411d

@jerqi jerqi linked an issue Nov 27, 2022 that may be closed by this pull request
3 tasks
@tiantingting5435
Copy link
Contributor Author

@jerqi Hi, would you mind to take another look?

@jerqi
Copy link
Contributor

jerqi commented Nov 27, 2022

企业微信截图_55fa4767-5d89-4e27-b060-d259f1c71c9c

Please fix code style and ut. You can use the command mvn package -Pspark2, mvn package -Pspark3, mvn package -Pspark3 to run the uts on your local machine first.

@jerqi jerqi changed the title [ISSUE-285][Improvement] Only Use HDFS and LOCALFILE storageType in the test [ISSUE-285][Improvement] Only use HDFS and LOCALFILE storageType in the test Nov 27, 2022
@tiantingting5435
Copy link
Contributor Author

企业微信截图_55fa4767-5d89-4e27-b060-d259f1c71c9c

Please fix code style and ut. You can use the command mvn package -Pspark2, mvn package -Pspark3, mvn package -Pspark3 to run the uts on your local machine first.

@jerqi Thanks for the heads up, I think I've finished fixing the current known bugs.

@jerqi
Copy link
Contributor

jerqi commented Nov 28, 2022

You need to resolve the conflicts with master. you can use the command

 git remote add upstream git@github.com:apache/incubator-uniffle.git
 git fetch upstream
 git merge upstream/master

solve the conflicts and then

git add xxxxx
git merge --continue

@codecov-commenter
Copy link

codecov-commenter commented Nov 28, 2022

Codecov Report

Merging #360 (f868b54) into master (c503f8f) will decrease coverage by 0.72%.
The diff coverage is 50.00%.

@@             Coverage Diff              @@
##             master     #360      +/-   ##
============================================
- Coverage     58.59%   57.86%   -0.73%     
+ Complexity     1588     1371     -217     
============================================
  Files           193      171      -22     
  Lines         10888     9067    -1821     
  Branches        954      797     -157     
============================================
- Hits           6380     5247    -1133     
+ Misses         4132     3486     -646     
+ Partials        376      334      -42     
Impacted Files Coverage Δ
...va/org/apache/uniffle/client/util/ClientUtils.java 52.27% <0.00%> (-5.23%) ⬇️
...rg/apache/uniffle/client/util/RssClientConfig.java 0.00% <ø> (ø)
.../java/org/apache/uniffle/server/ShuffleServer.java 67.39% <40.00%> (-1.03%) ⬇️
.../org/apache/uniffle/common/config/RssBaseConf.java 93.63% <100.00%> (+0.20%) ⬆️
.../java/org/apache/hadoop/mapreduce/RssMRConfig.java
...apache/hadoop/mapreduce/v2/app/RssMRAppMaster.java
.../java/org/apache/spark/shuffle/RssSparkConfig.java
...org/apache/spark/shuffle/RssSparkShuffleUtils.java
.../hadoop/mapreduce/task/reduce/RssEventFetcher.java
...rg/apache/hadoop/mapred/RssMapOutputCollector.java
... and 16 more

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

@@ -283,7 +283,7 @@ public <K, V, C> ShuffleHandle registerShuffle(int shuffleId, int numMaps, Shuff

private void startHeartbeat() {
shuffleWriteClient.registerApplicationInfo(appId, heartbeatTimeout, user);
if (!sparkConf.getBoolean(RssSparkConfig.RSS_TEST_FLAG.key(), false) && !heartbeatStarted) {
if (!sparkConf.getBoolean(RssSparkConfig.RSS_TEST_MODE.key(), false) && !heartbeatStarted) {
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto.

@@ -188,7 +188,7 @@ public RssShuffleManager(SparkConf sparkConf, boolean isDriver) {
// External shuffle service is not supported when using remote shuffle service
sparkConf.set("spark.shuffle.service.enabled", "false");
LOG.info("Disable external shuffle service in RssShuffleManager.");
if (!sparkConf.getBoolean(RssSparkConfig.RSS_TEST_FLAG.key(), false)) {
if (!sparkConf.getBoolean(RssSparkConfig.RSS_TEST_MODE.key(), false)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn't modify this place. It will cause that our spark2 integration tests fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The change here is to unify the test flags and use rss.test.mode.enable to confirm if it is a test mode. Using multiple parameters to mark a test mode tends to create redundancy and confusion in the parameters, UT fails I can fix it.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's a little difficult to unify them. Because RSS_TEST_FLAG is used for ShuffleFlushManagerTest, RSS_TEST_MODE is used for integration tests and uts.

Copy link
Contributor

Choose a reason for hiding this comment

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

They have different effect though they have similar names. For integraion tests, we need to set RSS_TEST_FLAG false value and set RSS_TEST_MODE true value.

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 see what you mean, give me some time to restore the original design.

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 @tiantingting5435 a lot. It's great work!

@jerqi jerqi merged commit 884921b into apache:master Nov 29, 2022
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.

[Improvement] Only Use HDFS and LOCALFILE storageType in the test
3 participants