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

[#1554] feat(spark): Fetch dynamic client conf as early as possible #1557

Merged
merged 8 commits into from
Mar 14, 2024

Conversation

EnricoMi
Copy link
Contributor

@EnricoMi EnricoMi commented Mar 5, 2024

What changes were proposed in this pull request?

Fetches dynamic client config as early as possible, to be able to use dynamic client config to create the shuffle client with updated config.

Why are the changes needed?

Providing config or the shuffle client via coordinator is operationally useful as cluster-wide settings can be deployed through the cluster and changed over time. Clients and apps do not need to change configs.

Fixes Spark part of #1554

Does this PR introduce any user-facing change?

More configs can be provided via coordinators.

How was this patch tested?

Existing and follow-up unit tests.

Copy link

github-actions bot commented Mar 5, 2024

Test Results

 2 340 files  ± 0   2 340 suites  ±0   4h 33m 42s ⏱️ + 2m 43s
   908 tests + 4     907 ✅ + 5   1 💤  - 1  0 ❌ ±0 
10 541 runs  +36  10 527 ✅ +45  14 💤  - 9  0 ❌ ±0 

Results for commit 33ac575. ± Comparison against base commit 9737d57.

This pull request removes 1 and adds 5 tests. Note that renamed tests count towards both.
org.apache.uniffle.test.RssShuffleManagerTest ‑ testRssShuffleManagerDynamicClientConf{BlockIdLayout}
org.apache.uniffle.shuffle.manager.RssShuffleManagerBaseTest ‑ testFetchAndApplyDynamicConf
org.apache.uniffle.test.RssShuffleManagerTest ‑ testRssShuffleManagerClientConf{BlockIdLayout}[3]
org.apache.uniffle.test.RssShuffleManagerTest ‑ testRssShuffleManagerDynamicClientConf{BlockIdLayout}[1]
org.apache.uniffle.test.RssShuffleManagerTest ‑ testRssShuffleManagerDynamicClientConf{BlockIdLayout}[2]
org.apache.uniffle.test.RssShuffleManagerTest ‑ testRssShuffleManagerDynamicClientConf{BlockIdLayout}[3]

♻️ This comment has been updated with latest results.

@@ -78,6 +78,7 @@ public void testCreateFallback() throws Exception {
conf.set(RssSparkConfig.RSS_DYNAMIC_CLIENT_CONF_ENABLED.key(), "false");
conf.set(RssSparkConfig.RSS_ACCESS_ID.key(), "mockId");
conf.set(RssSparkConfig.RSS_ENABLED.key(), "true");
conf.set(RssSparkConfig.RSS_STORAGE_TYPE.key(), "MEMORY_LOCALFILE");
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 to add this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test further down asserts an exception is thrown. Moving RssSparkShuffleUtils.validateRssClientConf(sparkConf) up in the RssShuffleManager constructor throws a different exception if the storage type is not set.

Copy link
Contributor

Choose a reason for hiding this comment

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

Coordinator can apply the storage type to the client. Will this pull request affect this feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test calls into new RssShuffleManager(sparkConf, false), which mimics creating the shuffle manager on an executor, and executors do not fetch dynamic config, so the given sparkConf must have the storage type set for the test.

The logic of applying config is unchanged, this only happens earlier. I presume there are tests for this use case, which should check the desired behaviour is preserved.

@zuston
Copy link
Member

zuston commented Mar 6, 2024

And I think the PR title is not proper for this change, which don't reflect the feature of overwriting the existing client conf.

@codecov-commenter
Copy link

codecov-commenter commented Mar 6, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 54.94%. Comparing base (9737d57) to head (33ac575).

Files Patch % Lines
...org/apache/spark/shuffle/RssSparkShuffleUtils.java 80.00% 0 Missing and 1 partial ⚠️
...uniffle/shuffle/manager/RssShuffleManagerBase.java 95.23% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1557      +/-   ##
============================================
+ Coverage     53.96%   54.94%   +0.98%     
- Complexity     2858     2862       +4     
============================================
  Files           438      418      -20     
  Lines         24793    22455    -2338     
  Branches       2109     2111       +2     
============================================
- Hits          13379    12339    -1040     
+ Misses        10576     9348    -1228     
+ Partials        838      768      -70     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@EnricoMi
Copy link
Contributor Author

EnricoMi commented Mar 6, 2024

... overwriting the existing client conf.

this is not new, this existed before

@EnricoMi EnricoMi force-pushed the dynamic-client-conf branch from b687162 to 5d5cd9d Compare March 6, 2024 07:20
@EnricoMi EnricoMi force-pushed the dynamic-client-conf branch from 187ed27 to d97f826 Compare March 7, 2024 10:44
zuston
zuston previously approved these changes Mar 13, 2024
Copy link
Member

@zuston zuston 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
Copy link
Member

zuston commented Mar 13, 2024

Could you help resolve the conflict? @EnricoMi

@EnricoMi EnricoMi force-pushed the dynamic-client-conf branch from cc564bb to 33ac575 Compare March 13, 2024 10:13
@EnricoMi
Copy link
Contributor Author

Fixed.

@zuston zuston merged commit de50442 into apache:master Mar 14, 2024
41 checks passed
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.

4 participants