Uh oh!
There was an error while loading. Please reload this page.
[SPARK-32077][CORE] Support host-local shuffle data reading when external shuffle service is disabled - #28911
[SPARK-32077][CORE] Support host-local shuffle data reading when external shuffle service is disabled#28911Ngone51 wants to merge 48 commits into
Conversation
Ngone51
commented
Jun 23, 2020
@attilapiros@tgravescs@jiangxb1987 Please take a look, thanks! |
SparkQA
commented
Jun 23, 2020
Test build #124426 has finished for PR 28911 at commit
|
tgravescs
commented
Jun 23, 2020
thanks for working on this, was interested in this as well. Can you update the description to include details on your overall approach - where do you get the directories from, etc? |
Ngone51
commented
Jun 24, 2020
@tgravescs updated the description, thanks! |
Ngone51
commented
Jun 24, 2020
Jenkins, retest this please. |
SparkQA
commented
Jun 24, 2020
Test build #124454 has finished for PR 28911 at commit
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
SparkQA
commented
Jun 30, 2020
Test build #124662 has finished for PR 28911 at commit
|
Ngone51
commented
Jul 2, 2020
I've updated the PR. Could you take another look? |
SparkQA
commented
Jul 2, 2020
Test build #124905 has finished for PR 28911 at commit
|
Ngone51
commented
Jul 9, 2020
Jenkins, retest this please. |
SparkQA
commented
Jul 9, 2020
Test build #125437 has finished for PR 28911 at commit
|
mridulm
commented
Jul 9, 2020
@Ngone51 I am still catching up on changes; as part of #25299 or subsequently (or here) are we updating preferred locality for shuffle tasks to account for ability to do node local reads ? |
tgravescs
left a comment
There was a problem hiding this comment.
took a quick look and had a few comments, overall approach seems fine. I need to take a more in depth review.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Ngone51
commented
Jul 9, 2020
@mridulm we don't and no need to do it. The current implementation of spark/core/src/main/scala/org/apache/spark/MapOutputTracker.scala Lines 610 to 624 in 6fcb70e |
Ngone51
commented
Jul 9, 2020
@tgravescs Thanks for the review. I'll try to address them tomorrow. |
mridulm
commented
Jul 9, 2020
via email
The output is host, but size computation does not aggregate by host. …On Thu, Jul 9, 2020 at 9:45 AM wuyi ***@***.***> wrote:
@tgravescs <https://github.com/tgravescs> Thanks for the review. I'll try
to address them tomorrow.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#28911 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMETFBZGIMLWOFUE234CBDR2XX4NANCNFSM4OFYIFCQ>
.
|
Ngone51
commented
Jul 10, 2020
Ah, I get your point and I can imagine how it may affect current locality preference. Let's take an example to see if we're on the same page. For example, now we have executor1 and executor2 on node1, executor3 and executor4 on node2. And we also have 10 shuffle data bytes on executor1 and executor2 from task1 and task2 separately. Besides, we also have 40 shuffle data bytes on executor3 and executor4 from task3 and task4 separately. (Assuming all the shuffle data are for the same reduce partition.) With the current implementation of However, node1 can also be a preferred location if we aggregate the size of the shuffle data on the same host, since we will have (10 + 10 / 10 + 10 + 40 + 40) = 0.2 >= 0.2. It looks reasonable to me. cc @attilapiros@tgravescs@jiangxb1987@holdenk Any ideas? |
mridulm
commented
Jul 10, 2020
The fix for this need not necessarily come in this PR, but can be a feature addition. The solution is fairly straightforward, given existing implementation of |
SparkQA
commented
Jul 10, 2020
Test build #125589 has finished for PR 28911 at commit
|
holdenk
commented
Jul 17, 2020
Personally, I'd save locality changes for a follow up PR. Making changes in core is pretty hard, so long as we have a JIRA and it's a good incremental chunk of work keeping it smaller for review (and potential revert if something goes wrong) is better (of course there are situations where that isn't possible, but I think changing locality calculations would be strictly additive.) |
| * (when this is a NettyBlockTransferService). Note there's only one executor when this is a | ||
| * NettyBlockTransferService because we ask one specific executor at a time. |
There was a problem hiding this comment.
Can you clarify the last sentence here?
There was a problem hiding this comment.
Oh I got this.
When the external shuffle service is target by this request we can collect the local dirs of multiple executors at once (as all the host local dirs are available in the external shuffle service running on the host as it is central component in this sense on that host).
But here we can request the local dirs for only one executor: the one which handles the request itself.
@Ngone51 what about adding an assert here:
Checking the array only contains one executor ID and it is equal with the
executorId of the blockManager.There was a problem hiding this comment.
I added the check to ensure it's the only one executor id but didn't check its equality with blockManager's executor id. Because we only have BlockDataManager in NettyBlockRpcServer which does not expose executor id.
I am still wondering whether it's worthwhile to expose it for the sanity check purpose.
Uh oh!
There was an error while loading. Please reload this page.
Ngone51
commented
Jul 20, 2020
Thank you for the review. I'll try to address them tomorrow! |
1126341 to
bcb6012CompareSparkQA
commented
Jul 21, 2020
Test build #126227 has finished for PR 28911 at commit
|
Ngone51
commented
Jul 21, 2020
Jenkins, retest this please. |
SparkQA
commented
Jul 21, 2020
Test build #126234 has finished for PR 28911 at commit
|
SparkQA
commented
Aug 30, 2020
Test build #128022 has finished for PR 28911 at commit
|
attilapiros
commented
Aug 30, 2020
@Ngone51 The PR description mentions disabled dynamic allocation as requirement but this was changed as result of a review finding. Could you please update it? |
Ngone51
commented
Aug 31, 2020
Thank you @dongjoon-hyun for the detailed review. It helps a lot to improve PR. |
Ngone51
commented
Aug 31, 2020
@holdenk Sure, please feel free to add any comments! |
Ngone51
commented
Aug 31, 2020
@attilapiros Updated, thanks for the reminder! |
SparkQA
commented
Aug 31, 2020
Test build #128093 has finished for PR 28911 at commit
|
holdenk
left a comment
There was a problem hiding this comment.
Two minor points of clarification, but no blocking concerns from me after this review.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
SparkQA
commented
Sep 1, 2020
Test build #128139 has finished for PR 28911 at commit
|
dongjoon-hyun
commented
Sep 2, 2020
Retest this please. |
dongjoon-hyun
left a comment
There was a problem hiding this comment.
+1, LGTM. Merged to master for Apache Spark 3.1.0 on December 2020.
Thank you, @Ngone51 and all.
Ngone51
commented
Sep 3, 2020
Thank you all!! |
…rnal shuffle service is disabled This PR adds support to read host-local shuffle data from disk directly when external shuffle service is disabled. Similar to #25299, we first try to get local disk directories for the shuffle data, which is located at the same host with the current executor. The only difference is, in #25299, it gets the directories from the external shuffle service while in this PR, it gets the directory from the executors. To implement the feature, this PR extends the `HostLocalDirManager ` for both `ExternalBlockStoreClient` and `NettyBlockTransferService`. Also, this PR adds `getHostLocalDirs` for `NettyBlockTransferService` as `ExternalBlockStoreClient` does, in order to send the get-dir-request to the corresponding executor. And this PR resued the request message`GetLocalDirsForExecutors` for simple. After SPARK-27651 / #25299, Spark can read host-local shuffle data directly from disk when external shuffle service is enabled. To extend the future, we can also support it when the external shuffle service is disabled. Yes. Before this PR, to use the host-local shuffle reading feature, users should not only enable `spark.shuffle.readHostLocalDisk` but also `spark.shuffle.service.enabled`. After this PR, enable `spark.shuffle.readHostLocalDisk` should be enough, and external shuffle service is no longer a pre-requirement. Added test and tested manually. Closes#28911 from Ngone51/support_node_local_shuffle. Authored-by: yi.wu <yi.wu@databricks.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
What changes were proposed in this pull request?
This PR adds support to read host-local shuffle data from disk directly when external shuffle service is disabled.
Similar to #25299, we first try to get local disk directories for the shuffle data, which is located at the same host with the current executor. The only difference is, in #25299, it gets the directories from the external shuffle service while in this PR, it gets the directory from the executors.
To implement the feature, this PR extends the
HostLocalDirManagerfor bothExternalBlockStoreClientandNettyBlockTransferService. Also, this PR addsgetHostLocalDirsforNettyBlockTransferServiceasExternalBlockStoreClientdoes, in order to send the get-dir-request to the corresponding executor. And this PR resued the request messageGetLocalDirsForExecutorsfor simple.Why are the changes needed?
After SPARK-27651 / #25299, Spark can read host-local shuffle data directly from disk when external shuffle service is enabled. To extend the future, we can also support it when the external shuffle service is disabled.
Does this PR introduce any user-facing change?
Yes. Before this PR, to use the host-local shuffle reading feature, users should not only enable
spark.shuffle.readHostLocalDiskbut alsospark.shuffle.service.enabled. After this PR, enablespark.shuffle.readHostLocalDiskshould be enough, and external shuffle service is no longer a pre-requirement.How was this patch tested?
Added test and tested manually.