Skip to content

Comments

[SPARK-40968] Fix a few wrong/misleading comments in DAGSchedulerSuite#38371

Closed
JiexingLi wants to merge 5 commits intoapache:masterfrom
JiexingLi:fix-comments
Closed

[SPARK-40968] Fix a few wrong/misleading comments in DAGSchedulerSuite#38371
JiexingLi wants to merge 5 commits intoapache:masterfrom
JiexingLi:fix-comments

Conversation

@JiexingLi
Copy link
Contributor

@JiexingLi JiexingLi commented Oct 24, 2022

What changes were proposed in this pull request?

Fix a few wrong or misleading comments in DAGSchedulerSuite.

Why are the changes needed?

The wrong or misleading comments in DAGSchedulerSuite introduce confusions and make it harder to understanding the code.

Does this PR introduce any user-facing change?

No

How was this patch tested?

No code changes, pure comment changes.
Original tests pass.

@JiexingLi JiexingLi marked this pull request as ready for review October 24, 2022 08:27
@github-actions github-actions bot added the CORE label Oct 24, 2022
@HyukjinKwon
Copy link
Member

@JiexingLi please keep the PR desscription template (https://github.com/apache/spark/blob/master/.github/PULL_REQUEST_TEMPLATE) and keep the PR title formtted like others (see also https://spark.apache.org/contributing.html)

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@itholic
Copy link
Contributor

itholic commented Oct 28, 2022

@JiexingLi Can you address #38371 (comment) when you find some time? Just for reminder, take your time.

@JiexingLi JiexingLi changed the title Fix some comments in DAGSchedulerSuite [SPARK-40968] Fix a few wrong/misleading comments in DAGSchedulerSuite Oct 31, 2022
@JiexingLi
Copy link
Contributor Author

Thank @HyukjinKwon and @itholic for the information. I have now updated the PR description and added the ticket for the title.

Can you help take another look? Thank you so much.

Copy link
Member

Choose a reason for hiding this comment

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

This not only fixes the comment but the test codes. Mind elaborating this please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. The background is that: Wenchen and I were reading the related code, but felt confused about why line 3098 says: "Executor lost on hostB, both of stage 0 and 1 should be reran.".

After digging around, we found that stage0 completes in "hostA", "hostB" (the default hosts somewhere in the code). But it is not very obvious for reader to tell this.

So adding Seq("hostA", "hostB") to reader to easily get this. I further updated the comments too.

Copy link
Contributor

@mridulm mridulm Oct 31, 2022

Choose a reason for hiding this comment

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

This change is not required.
Fetch failed is due to stage 1 partition on hostB going missing - by default, completeShuffleMapStageSuccessfully will progressively complete on hostA, hostB, etc ... - it will result in recomputing 0 (since there are two partitions - on hostA and hostB) and 1 (due to fetch failure) - and 2 ofcourse.

In this case, since there is output on hostB for stage 0 (partition 1) and stage 1 (partition 0) , they are recomputed.

If it is confusing, we can add this to the javadoc of completeShuffleMapStageSuccessfully

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is not required. It is only added for better readability (as I mentioned, "hostA", "hostB" are the default hosts). In my opinion, having the value here, we don't need to go to read completeShuffleMapStageSuccessfully(), but only the code here, we can know what happen. Beside, it might be good to keep the two completeShuffleMapStageSuccessfully() consistent here (both having hostNames, or both not having hostNames)? Let me know if you think I should delete Seq("hostA", "hostB") here.

I added "In case no hostNames are provided, the tasks will progressively complete on hostA, hostB, etc." to completeShuffleMapStageSuccessfully().

Copy link
Contributor

Choose a reason for hiding this comment

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

Enhancing documentation of completeShuffleMapStageSuccessfully is sufficient - we dont want to explicitly specify hostNames for all invocations of the method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. Deleted the hostNames param.

Copy link
Contributor

@mridulm mridulm Oct 31, 2022

Choose a reason for hiding this comment

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

The comment could read - "Executor lost on hostB, both of stage 0 and 1 should be rerun - as part of recomputation of stage 2" : since there is output on hostB for stage 0 (see completeShuffleMapStageSuccessfully), and stage 1.

But looks fine to me even without the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, Mridul.

I updated the comment. Your rewrite is very neat and clear.

Copy link
Contributor

Choose a reason for hiding this comment

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

mapRdd actually.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, my bad.

Thanks and updated.

@mridulm
Copy link
Contributor

mridulm commented Nov 2, 2022

Merged to master, thanks or fixing this @JiexingLi !
Thanks for looking into this @HyukjinKwon :-)

@JiexingLi JiexingLi deleted the fix-comments branch November 2, 2022 08:56
SandishKumarHN pushed a commit to SandishKumarHN/spark that referenced this pull request Dec 12, 2022
### What changes were proposed in this pull request?
Fix a few wrong or misleading comments in DAGSchedulerSuite.

### Why are the changes needed?
The wrong or misleading comments in DAGSchedulerSuite introduce confusions and make it harder to understanding the code.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
No code changes, pure comment changes.
Original tests pass.

Closes apache#38371 from JiexingLi/fix-comments.

Authored-by: JiexingLi <jiexing.li@databricks.com>
Signed-off-by: Mridul <mridul<at>gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants