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

[#1398] fix(mr,tez): Make attempId computable and move it to taskAttemptId in BlockId layout. #1418

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

qijiale76
Copy link
Contributor

@qijiale76 qijiale76 commented Jan 4, 2024

What changes were proposed in this pull request?

Before this PR, in MR and TEZ engine:

  1. attemptId is in sequenceNo of BlockId instead of taskAttemptId.
  2. attempId is fixed 6 bit.

After this PR:

  1. attemptId is in taskAttemptId. This is more reasonable.
  2. attempId is calculated from max num of allowed failures and whether speculative execution is enabled.

Why are the changes needed?

Fix: #1398

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Existing UT and integrated tests.

@codecov-commenter
Copy link

codecov-commenter commented Jan 4, 2024

Codecov Report

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

Project coverage is 54.88%. Comparing base (dd67774) to head (bc5585d).
Report is 4 commits behind head on master.

Files Patch % Lines
...c/main/java/org/apache/tez/common/RssTezUtils.java 76.19% 4 Missing and 1 partial ⚠️
...rg/apache/hadoop/mapred/RssMapOutputCollector.java 0.00% 3 Missing ⚠️
...library/common/shuffle/impl/RssTezFetcherTask.java 0.00% 3 Missing ⚠️
...library/common/shuffle/impl/RssShuffleManager.java 0.00% 2 Missing ⚠️
...n/java/org/apache/hadoop/mapreduce/RssMRUtils.java 95.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1418      +/-   ##
============================================
+ Coverage     54.01%   54.88%   +0.87%     
- Complexity     2863     2868       +5     
============================================
  Files           438      418      -20     
  Lines         24850    22552    -2298     
  Branches       2114     2120       +6     
============================================
- Hits          13423    12378    -1045     
+ Misses        10586     9406    -1180     
+ Partials        841      768      -73     

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

@qijiale76
Copy link
Contributor Author

@jerqi Could you please provide suggestions on areas that need improvement?

@zuston
Copy link
Member

zuston commented Jan 8, 2024

cc @zhengchenyu could you help review this ?

@zhengchenyu
Copy link
Collaborator

Sine #1529 is merged into master, I think we should review this PR?
After this PR, the blockid calculation for spark, mr, tez will remain consistent. Then we will reduce the probability of overflow problems.

@qijiale76 Can you reconstruct the code according to #1529?

@zuston
Copy link
Member

zuston commented Feb 29, 2024

@qijiale76 Do you want to push this forward?

@qijiale76
Copy link
Contributor Author

@qijiale76 Do you want to push this forward?

Yes, I’ll reconstruct the code next week.

Copy link

github-actions bot commented Mar 21, 2024

Test Results

 2 657 files  +10   2 657 suites  +10   5h 30m 55s ⏱️ + 4m 6s
   946 tests ± 0     944 ✅ ± 0   1 💤 ±0  0 ❌ ±0  1 🔥 ±0 
11 799 runs  +20  11 783 ✅ +20  15 💤 ±0  0 ❌ ±0  1 🔥 ±0 

For more details on these errors, see this check.

Results for commit a543fd2. ± Comparison against base commit e0a2e3d.

This pull request removes 2 and adds 2 tests. Note that renamed tests count towards both.
org.apache.uniffle.shuffle.manager.RssShuffleManagerBaseTest ‑ testGetAttemptIdBits
org.apache.uniffle.shuffle.manager.RssShuffleManagerBaseTest ‑ testGetMaxAttemptNo
org.apache.uniffle.client.ClientUtilsTest ‑ testGetMaxAttemptNo
org.apache.uniffle.client.ClientUtilsTest ‑ testGetNumberOfSignificantBits

♻️ This comment has been updated with latest results.

@jerqi jerqi changed the title [#1398] fix(MR)(TEZ): Limit attemptId to 4 bit and move it from 18 bit atomicInt to 21 bit taskAttemptId in 63 bit BlockId. [#1398] fix(mr,tez): Limit attemptId to 4 bit and move it from 18 bit atomicInt to 21 bit taskAttemptId in 63 bit BlockId. Mar 28, 2024
@qijiale76 qijiale76 requested a review from EnricoMi March 28, 2024 11:19
@qijiale76 qijiale76 changed the title [#1398] fix(mr,tez): Limit attemptId to 4 bit and move it from 18 bit atomicInt to 21 bit taskAttemptId in 63 bit BlockId. [#1398] fix(mr,tez): Make attempId computable and move it to taskAttemptId in BlockId layout. Mar 28, 2024
@qijiale76 qijiale76 marked this pull request as ready for review March 28, 2024 11:40
@qijiale76
Copy link
Contributor Author

@EnricoMi Thanks for your very helpful review. I have updated this PR based on your suggestions and by referring to Spark's implementation. Could you please review the latest code again?

@qijiale76 qijiale76 requested a review from EnricoMi April 17, 2024 10:39
# Conflicts:
#	client-spark/common/src/main/java/org/apache/uniffle/shuffle/manager/RssShuffleManagerBase.java
#	client-tez/src/main/java/org/apache/tez/runtime/library/common/shuffle/impl/RssTezFetcherTask.java
@qijiale76 qijiale76 requested a review from EnricoMi June 28, 2024 06:18
@qijiale76
Copy link
Contributor Author

@EnricoMi, thank you very much for your reviews. I have reverted taskAttemptIds to long in the MR, Tez, and Spark engine clients. Could you please review this PR again?

@qijiale76 qijiale76 requested a review from jerqi July 2, 2024 02:24
@zhengchenyu
Copy link
Collaborator

@jerqi I still think taskattemptid should be int. Since we've limited taskattemptid to no more than 32 bits, int is enough. For spark, taskattemptid has changed, now does not comes from TaskContext::taskAttemptId.

See the code:

if (sequenceNoBits >= 32 || partitionIdBits >= 32 || taskAttemptIdBits >= 32) {

@EnricoMi
Copy link
Contributor

EnricoMi commented Jul 4, 2024

Code paths that work fine with long taskAttemptIds should show that via using long, paths that are limited to int ids should indicate that using int. Then you know what the code supports and which code has limitations.

Copy link
Contributor

@EnricoMi EnricoMi left a comment

Choose a reason for hiding this comment

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

LGTM!

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] [TEZ][MR] blockid will be overflows when the shuffle data is large enough.
6 participants