Skip to content

[#1231] feat(tez): Support remote spill in merge stage. - #1245

Merged
roryqi merged 3 commits into
apache:masterfrom
zhengchenyu:ISSUE-1231
Oct 19, 2023
Merged

[#1231] feat(tez): Support remote spill in merge stage.#1245
roryqi merged 3 commits into
apache:masterfrom
zhengchenyu:ISSUE-1231

Conversation

@zhengchenyu

Copy link
Copy Markdown
Collaborator

What changes were proposed in this pull request?

Add new merger manager for remote spill.

Why are the changes needed?

In a cloud scenario, the storage of the machine that performs the job is very small. The merge phase often uses disk. The remote spill allows remote shuffle service job to use as little disk as possible.

Fix: #1231

Does this PR introduce any user-facing change?

config description
tez.rss.reduce.remote.spill.enable Whether to enable remote spill
tez.rss.remote.spill.storage.path the remote spill path
rss.reduce.remote.spill.replication the replication of remote fs
rss.reduce.remote.spill.retries try times for remote fs

How was this patch tested?

unit test, integration test, tez examples on cluster.

@roryqi
roryqi requested a review from lifeSo October 18, 2023 02:45
@codecov-commenter

codecov-commenter commented Oct 18, 2023

Copy link
Copy Markdown

Codecov Report

Merging #1245 (b0f0bfc) into master (30332a4) will increase coverage by 1.35%.
Report is 1 commits behind head on master.
The diff coverage is 73.45%.

@@             Coverage Diff              @@
##             master    #1245      +/-   ##
============================================
+ Coverage     53.70%   55.06%   +1.35%     
- Complexity     2615     2647      +32     
============================================
  Files           394      376      -18     
  Lines         22699    20653    -2046     
  Branches       1937     1971      +34     
============================================
- Hits          12191    11372     -819     
+ Misses         9766     8585    -1181     
+ Partials        742      696      -46     
Files Coverage Δ
.../main/java/org/apache/tez/common/RssTezConfig.java 92.85% <ø> (ø)
...rary/common/shuffle/orderedgrouped/RssShuffle.java 53.29% <61.29%> (-1.25%) ⬇️
...mmon/shuffle/orderedgrouped/RssInMemoryMerger.java 79.22% <79.22%> (ø)
...common/shuffle/orderedgrouped/RssMergeManager.java 73.14% <73.14%> (ø)

... and 22 files with indirect coverage changes

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

+ usedMemory
+ ", mapOutput="
+ mapOutput);
} else {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if (LOG.isDebugEnabled()) {
      LOG.debug(
          "closeInMemoryFile -> map-output of size: "
              + mapOutput.getSize()
              + ", inMemoryMapOutputs.size() -> "
              + inMemoryMapOutputs.size()
              + ", commitMemory -> "
              + commitMemory
              + ", usedMemory ->"
              + usedMemory
              + ", mapOutput="
              + mapOutput);
    }
statsInMemLastLog.updateStats(mapOutput.getSize());

Maybe we could remove the else.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

if (LOG.isDebugEnabled()) {
      LOG.debug(
          "closeInMemoryFile -> map-output of size: "
              + mapOutput.getSize()
              + ", inMemoryMapOutputs.size() -> "
              + inMemoryMapOutputs.size()
              + ", commitMemory -> "
              + commitMemory
              + ", usedMemory ->"
              + usedMemory
              + ", mapOutput="
              + mapOutput);
    }
statsInMemLastLog.updateStats(mapOutput.getSize());

Maybe we could remove the else.

@jerqi
Here is to keep the same logic as tez.
In order to avoid excessive logs, info-level logs are printed every 30 seconds.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OK.

@roryqi

roryqi commented Oct 18, 2023

Copy link
Copy Markdown
Contributor

@lifeSo @bin41215 @zhuyaogai Could you help review this pr?

throw e;
} finally {
if (writer != null) {
writer.close();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we close this writer in the Line#179?

@zhengchenyu zhengchenyu Oct 18, 2023

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Why do we close this writer in the Line#179?

@jerqi
Both TezMerger.merge and TezMerger.writeFile may throw exception. If throw exception, writer will not be closed.
By the way, both Line#179 and Line#181 seems useless. But by my debug, I found Line#180 must be called after Line#179. And we can not move Line#180 to finally block.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you add some comments to explain why? It's a little weird.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Could you add some comments to explain why? It's a little weird.

OK, I have comment it.

@roryqi roryqi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, @lifeSo @bin41215 @zhuyaogai Any suggestion?

@roryqi

roryqi commented Oct 19, 2023

Copy link
Copy Markdown
Contributor

Merged to master. Thanks @zhengchenyu

@roryqi
roryqi merged commit 4f56e59 into apache:master Oct 19, 2023
@zhengchenyu
zhengchenyu deleted the ISSUE-1231 branch October 20, 2023 01:52
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.

[FEATURE] [TEZ] Support remote spill in merge stage.

3 participants