You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/09/19 21:25:56 UTC

[GitHub] [spark] f-thiele opened a new pull request #34043: [SPARK-36782] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

f-thiele opened a new pull request #34043:
URL: https://github.com/apache/spark/pull/34043


   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
     8. If you want to add or modify an error type or message, please read the guideline first in
        'core/src/main/resources/error/README.md'.
   -->
   
   ### What changes were proposed in this pull request?
   Delegate `UpdateBlockInfo` from `dispatcher-BlockManagerMaster` to the threadpool to avoid blocking the endpoint. Introduce a unit test that forces `MapOutputTracker` to make a broadcast as part of `MapOutputTracker.serializeOutputStatuses` when running decommission tests.
   
   To avoid `java.util.ConcurrentModificationException` read and write locks are introduced on `blockLocations`.
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   
   ### Why are the changes needed?
   [SPARK-36782](https://issues.apache.org/jira/browse/SPARK-36782) describes a deadlock occurring if the `dispatcher-BlockManagerMaster` is allowed to block while waiting for write access to data structures.
   
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   
   ### How was this patch tested?
   Unit test as introduced in this PR.
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   
   ---
   
   Ping @eejbyfeldt for notice.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924804715


   **[Test build #143506 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143506/testReport)** for PR 34043 at commit [`306fa17`](https://github.com/apache/spark/commit/306fa172c32a389faecd4fb1aeca9f9e2e44d884).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm commented on a change in pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
mridulm commented on a change in pull request #34043:
URL: https://github.com/apache/spark/pull/34043#discussion_r714097032



##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -573,39 +576,41 @@ class BlockManagerMasterEndpoint(
       blockId: BlockId,
       storageLevel: StorageLevel,
       memSize: Long,
-      diskSize: Long): Boolean = {
+      diskSize: Long): Future[Boolean] = {
     logDebug(s"Updating block info on master ${blockId} for ${blockManagerId}")
 
     if (blockId.isShuffle) {
       blockId match {
         case ShuffleIndexBlockId(shuffleId, mapId, _) =>
           // We need to update this at index file because there exists the index-only block
           logDebug(s"Received shuffle index block update for ${shuffleId} ${mapId}, updating.")
-          mapOutputTracker.updateMapOutput(shuffleId, mapId, blockManagerId)
-          return true
+          return Future {
+            mapOutputTracker.updateMapOutput(shuffleId, mapId, blockManagerId)
+            true
+          }

Review comment:
       Can we move the log statement into the future as well ? so that it is emitted just before invoking updateMapOutput.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] attilapiros commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
attilapiros commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-923978871


   ok to test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] Ngone51 commented on a change in pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
Ngone51 commented on a change in pull request #34043:
URL: https://github.com/apache/spark/pull/34043#discussion_r714465842



##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -117,12 +117,15 @@ class BlockManagerMasterEndpoint(
 
     case _updateBlockInfo @
         UpdateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size) =>
-      val isSuccess = updateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size)
-      context.reply(isSuccess)
-      // SPARK-30594: we should not post `SparkListenerBlockUpdated` when updateBlockInfo
-      // returns false since the block info would be updated again later.
-      if (isSuccess) {
-        listenerBus.post(SparkListenerBlockUpdated(BlockUpdatedInfo(_updateBlockInfo)))
+      val response = updateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size)
+
+      response.foreach { isSuccess =>
+        // SPARK-30594: we should not post `SparkListenerBlockUpdated` when updateBlockInfo
+        // returns false since the block info would be updated again later.
+        if (isSuccess) {
+          listenerBus.post(SparkListenerBlockUpdated(BlockUpdatedInfo(_updateBlockInfo)))
+        }
+        context.reply(isSuccess)

Review comment:
       Yes!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
mridulm commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924492762


   Thanks for the jira and stack trace - that was really helpful !
   Looking at it more, the issue here is that we are relying on `BlockManagerMasterEndpoint` to update state in `MapOutputTracker` (which is usually done via `DAGScheduler`).
   
   Given there is no state mod for shuffle blocks when `UpdateBlockInfo` is received, it would simply be better to move just that codepath to a different thread - instead of trying to add fine grained locking for rest of `BlockManagerMasterEndpoint` (the change in sufficient to do that unfortunately).
   
   I am still testing locally, and making sure there are no issues - but the gist is:
   
   * `updateBlockInfo` returns `Future[Boolean]`
   * When `blockId` is a shuffle block - return a `Future { }` around the existing `blockId match`
   * For all other return in that method, use `Future.successful` to complete immediately.
   * As with the current PR, chain the future to return response.
   
   For shuffle blocks, it will should executed outside of the `BlockManagerMasterEndpoint`, while for the rest, it will get executed within the lock - and so no need to change rest of the state's MT safety.
   
   
   Thoughts ?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925232828


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/143508/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] Ngone51 commented on a change in pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
Ngone51 commented on a change in pull request #34043:
URL: https://github.com/apache/spark/pull/34043#discussion_r714472130



##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -117,12 +117,15 @@ class BlockManagerMasterEndpoint(
 
     case _updateBlockInfo @
         UpdateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size) =>
-      val isSuccess = updateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size)
-      context.reply(isSuccess)
-      // SPARK-30594: we should not post `SparkListenerBlockUpdated` when updateBlockInfo
-      // returns false since the block info would be updated again later.
-      if (isSuccess) {
-        listenerBus.post(SparkListenerBlockUpdated(BlockUpdatedInfo(_updateBlockInfo)))
+      val response = updateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size)
+
+      response.foreach { isSuccess =>
+        // SPARK-30594: we should not post `SparkListenerBlockUpdated` when updateBlockInfo
+        // returns false since the block info would be updated again later.
+        if (isSuccess) {
+          listenerBus.post(SparkListenerBlockUpdated(BlockUpdatedInfo(_updateBlockInfo)))
+        }
+        context.reply(isSuccess)

Review comment:
       Sure!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925163019


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/48018/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-923980810


   **[Test build #143473 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143473/testReport)** for PR 34043 at commit [`1278c41`](https://github.com/apache/spark/commit/1278c41e88e18fdabdcbc3b0938f827327ecf262).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924920755


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/143506/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
mridulm commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925075086


   @Ngone51 I was initially thinking along same lines - to move the shuffle map updates to `DAGScheduler` as well.
   But given `UpdateBlockInfo` rpc, the incoming rpc would come to `BlockManagerMasterEndpoint`.
   Given there was no MT-safety reason to delegate to `DAGScheduler`, I was thinking along the lines of what @f-thiele's change : we already have other `Future` invocations in BlockManagerMasterEndpoint.
   
   Thoughts on this PR ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925093988


   **[Test build #143508 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143508/testReport)** for PR 34043 at commit [`26b3b11`](https://github.com/apache/spark/commit/26b3b1118cc9701127c359b69b25ecf3a023c748).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924023102


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/47984/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924877750


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/48016/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
mridulm commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924466681


   +CC @Ngone51, @holdenk 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924920755


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/143506/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-923980810


   **[Test build #143473 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143473/testReport)** for PR 34043 at commit [`1278c41`](https://github.com/apache/spark/commit/1278c41e88e18fdabdcbc3b0938f827327ecf262).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924073797


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/47984/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm edited a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
mridulm edited a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924470756


   Can we add a test which surfaces this issue ?
   I want to see if alternate approaches will work on not (and use the test to validate the required functionality).
   Or are the changes to `BlockManagerDecommissionIntegrationSuite` sufficient ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm commented on a change in pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
mridulm commented on a change in pull request #34043:
URL: https://github.com/apache/spark/pull/34043#discussion_r714464726



##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -117,12 +117,15 @@ class BlockManagerMasterEndpoint(
 
     case _updateBlockInfo @
         UpdateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size) =>
-      val isSuccess = updateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size)
-      context.reply(isSuccess)
-      // SPARK-30594: we should not post `SparkListenerBlockUpdated` when updateBlockInfo
-      // returns false since the block info would be updated again later.
-      if (isSuccess) {
-        listenerBus.post(SparkListenerBlockUpdated(BlockUpdatedInfo(_updateBlockInfo)))
+      val response = updateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size)
+
+      response.foreach { isSuccess =>
+        // SPARK-30594: we should not post `SparkListenerBlockUpdated` when updateBlockInfo
+        // returns false since the block info would be updated again later.
+        if (isSuccess) {
+          listenerBus.post(SparkListenerBlockUpdated(BlockUpdatedInfo(_updateBlockInfo)))
+        }
+        context.reply(isSuccess)

Review comment:
       Did not realize this - thanks for pointing it out !
   So if I understood it right, the proposal is:
   
   ```
     def handleResult(success: Boolean): Unit = {
       if (success) {
         // post
       }
       context.reply(success)
     }
   
     if (blockId.isShuffle) {
       updateShuffleBlockInfo( ... ).foreach( handleResult(_))
     } else {
       handleResult(updateBlockInfo( ... ))
     }
   ```
   ?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
mridulm commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924304542


   This is going to make analysis/evolution of the code more complex, so I want to understand better why are we doing this ? What is the current issue/bottleneck and how much of it is mitigated by this change ?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] gengliangwang commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
gengliangwang commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924897381


   @f-thiele @eejbyfeldt  thanks for the fix.
   @mridulm @Ngone51 I would like to have this one in 3.2 if it doesn't take too much time.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
mridulm commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925251026


   @attilapiros I have not followed node decommissioning discussions in detail, hopefully @holdenk or @dongjoon-hyun can comment more here.
   
   When looking at the affected codepaths, `BlockManager` is not currently differentiating between the block id's in `tryToReportBlockStatus` when it is updating driver (normal and for block migration).
   Until node decommissioning, this path was used for non-shuffle blocks iirc.
   
   IMO handling the shuffle vs non-shuffle split while processing `UpdateBlockInfo` at driver is cleaner than spreading it out to caller; unless we have other issues in doing so (for example: MT-safety, correctness, design hygine, etc concerns).
   Thoughts ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] Ngone51 commented on a change in pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
Ngone51 commented on a change in pull request #34043:
URL: https://github.com/apache/spark/pull/34043#discussion_r714433856



##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -117,12 +117,15 @@ class BlockManagerMasterEndpoint(
 
     case _updateBlockInfo @
         UpdateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size) =>
-      val isSuccess = updateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size)
-      context.reply(isSuccess)
-      // SPARK-30594: we should not post `SparkListenerBlockUpdated` when updateBlockInfo
-      // returns false since the block info would be updated again later.
-      if (isSuccess) {
-        listenerBus.post(SparkListenerBlockUpdated(BlockUpdatedInfo(_updateBlockInfo)))
+      val response = updateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size)
+
+      response.foreach { isSuccess =>
+        // SPARK-30594: we should not post `SparkListenerBlockUpdated` when updateBlockInfo
+        // returns false since the block info would be updated again later.
+        if (isSuccess) {
+          listenerBus.post(SparkListenerBlockUpdated(BlockUpdatedInfo(_updateBlockInfo)))
+        }
+        context.reply(isSuccess)

Review comment:
       This causes the responses of non-shuffle blocks also be handled in the thread pool. I'm afraid this introduces unexpected overhead. Shall we only do this for the shuffle blocks only and leave the non-shuffle blocks the same behaviour?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924118067


   **[Test build #143473 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143473/testReport)** for PR 34043 at commit [`1278c41`](https://github.com/apache/spark/commit/1278c41e88e18fdabdcbc3b0938f827327ecf262).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #34043: [SPARK-36782] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-922543205


   Can one of the admins verify this patch?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925230286


   **[Test build #143508 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143508/testReport)** for PR 34043 at commit [`26b3b11`](https://github.com/apache/spark/commit/26b3b1118cc9701127c359b69b25ecf3a023c748).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm commented on a change in pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
mridulm commented on a change in pull request #34043:
URL: https://github.com/apache/spark/pull/34043#discussion_r714471870



##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -117,12 +117,15 @@ class BlockManagerMasterEndpoint(
 
     case _updateBlockInfo @
         UpdateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size) =>
-      val isSuccess = updateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size)
-      context.reply(isSuccess)
-      // SPARK-30594: we should not post `SparkListenerBlockUpdated` when updateBlockInfo
-      // returns false since the block info would be updated again later.
-      if (isSuccess) {
-        listenerBus.post(SparkListenerBlockUpdated(BlockUpdatedInfo(_updateBlockInfo)))
+      val response = updateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size)
+
+      response.foreach { isSuccess =>
+        // SPARK-30594: we should not post `SparkListenerBlockUpdated` when updateBlockInfo
+        // returns false since the block info would be updated again later.
+        if (isSuccess) {
+          listenerBus.post(SparkListenerBlockUpdated(BlockUpdatedInfo(_updateBlockInfo)))
+        }
+        context.reply(isSuccess)

Review comment:
       Given @gengliangwang has merged it, can you create a follow up PR ? We can merge it pretty quickly and possible make that into current 3.2 RC as well :)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] Ngone51 edited a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
Ngone51 edited a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924860943


   > With the proposed changes I suppose we don't actually delegate it to the DAGScheduler (as suggested by @Ngone51) but to the block-manager-ask-thread-pool. If this is undesired, I believe there's a more fundamental change needed?
   
   @f-thiele  We can get the `dagScheduler` by `BlockManagerMasterEndpoint.listenerBus.sparkContext.dagScheduler` (should expose  `sparkContext` in `listenerBus` as `private[spark]` ) and add a new function in `dagScheduler` to handle the specific `UpdateBlockInfo` of migrated shuffle block. (You could follow `dagScheduler.executorAdded` as an example). So I actually don't expect too much fundamental changes here.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm edited a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
mridulm edited a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924492762


   Thanks for the jira and stack trace - that was really helpful !
   Looking at it more, the issue here is that we are relying on `BlockManagerMasterEndpoint` to update state in `MapOutputTracker` (which is usually done via `DAGScheduler`).
   
   Given there is no state mod for shuffle blocks when `UpdateBlockInfo` is received, it would simply be better to move just that codepath to a different thread - instead of trying to add fine grained locking for rest of `BlockManagerMasterEndpoint` (the change insufficient to do that unfortunately).
   
   I am still testing locally, and making sure there are no issues - but the gist is:
   
   * `updateBlockInfo` returns `Future[Boolean]`
   * When `blockId` is a shuffle block - return a `Future { }` around the existing `blockId match`
   * For all other return in that method, use `Future.successful` to complete immediately.
   * As with the current PR, chain the future to return response.
   
   For shuffle blocks, it will should executed outside of the `BlockManagerMasterEndpoint`, while for the rest, it will get executed within the lock - and so no need to change rest of the state's MT safety.
   
   
   Thoughts ?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] attilapiros commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
attilapiros commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925124177


   Even the existing code shows this as when we talk about a shuffle block the `updateBlockInfo` (in all the three branches) we return:
   
   https://github.com/apache/spark/blob/26b3b1118cc9701127c359b69b25ecf3a023c748/core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala#L582-L598


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] Ngone51 commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
Ngone51 commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924860943


   > With the proposed changes I suppose we don't actually delegate it to the DAGScheduler (as suggested by @Ngone51) but to the block-manager-ask-thread-pool. If this is undesired, I believe there's a more fundamental change needed?
   
   @f-thiele  We can get the `dagScheduler` by `BlockManagerMasterEndpoint.listenerBus.sparkContext.dagScheduler` (should expose  `sparkContext` in `listenerBus` as `private[spark]` ) and added a new function in `dagScheduler` to handle the specific `UpdateBlockInfo` of migrated shuffle block. (You could follow `dagScheduler.executorAdded` as an example). So I actually don't expect much more fundamental changes here.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] gengliangwang closed pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
gengliangwang closed pull request #34043:
URL: https://github.com/apache/spark/pull/34043


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] Ngone51 commented on a change in pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
Ngone51 commented on a change in pull request #34043:
URL: https://github.com/apache/spark/pull/34043#discussion_r714433856



##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -117,12 +117,15 @@ class BlockManagerMasterEndpoint(
 
     case _updateBlockInfo @
         UpdateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size) =>
-      val isSuccess = updateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size)
-      context.reply(isSuccess)
-      // SPARK-30594: we should not post `SparkListenerBlockUpdated` when updateBlockInfo
-      // returns false since the block info would be updated again later.
-      if (isSuccess) {
-        listenerBus.post(SparkListenerBlockUpdated(BlockUpdatedInfo(_updateBlockInfo)))
+      val response = updateBlockInfo(blockManagerId, blockId, storageLevel, deserializedSize, size)
+
+      response.foreach { isSuccess =>
+        // SPARK-30594: we should not post `SparkListenerBlockUpdated` when updateBlockInfo
+        // returns false since the block info would be updated again later.
+        if (isSuccess) {
+          listenerBus.post(SparkListenerBlockUpdated(BlockUpdatedInfo(_updateBlockInfo)))
+        }
+        context.reply(isSuccess)

Review comment:
       This causes the responses of non-shuffle blocks also be handled in the thread pool. I'm afraid this introduces unexpected overhead. Shall we only do this for the shuffle blocks only and leave the non-shuffle block the same behavior as it is?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] gengliangwang edited a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
gengliangwang edited a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925506975


   Merging to master/3.2/3.1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925093988


   **[Test build #143508 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143508/testReport)** for PR 34043 at commit [`26b3b11`](https://github.com/apache/spark/commit/26b3b1118cc9701127c359b69b25ecf3a023c748).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
mridulm commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924470756


   Can we add a test which surfaces this issue ?
   In addition to the general need for test, more specifically I want to see if alternate approaches will work on not (and use the test to validate the required functionality).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] f-thiele commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
f-thiele commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924801194


   > I am still testing locally, and making sure there are no issues - but the gist is:
   > 
   >    * updateBlockInfo returns Future[Boolean]
   >    * When blockId is a shuffle block - return a Future { } around the existing blockId match
   >    * For all other return in that method, use Future.successful to complete immediately.
   >    * As with the current PR, chain the future to return response.
   > 
   
   Thanks @mridulm. This was very helpful. I agree it would be good to have a different architectural approach than the here presented extra locks. I tried out your suggestions in 306fa172c32a389faecd4fb1aeca9f9e2e44d884 and my tests at least pass fine. Now the change is much more localized with no additional locking.
   
   I don't know whether the repo standard procedure is to close this PR and open a new one with your suggestions or to adapt the existing one - I just pushed my changes here assuming the latter but let me know in case you prefer to open a new PR.
   
   With the proposed changes I suppose we don't actually delegate it to the `DAGScheduler` (as suggested by @Ngone51) but to the `block-manager-ask-thread-pool`. If this is undesired, I believe there's a more fundamental change needed?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924128528


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/143473/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] eejbyfeldt commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
eejbyfeldt commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924334388


   > This is going to make analysis/evolution of the code more complex, so I want to understand better why are we doing this ? What is the current issue/bottleneck and how much of it is mitigated by this change ?
   
   The goal is to fix the deadlock that is described in detail in [SPARK-36782](https://issues.apache.org/jira/browse/SPARK-36782). From our testing this deadlock is common enough meaning that we can not use the decommission features introduced in 3.1.1, since when the deadlock happens the driver does not seem to recover and the spark job en up failing. The patch should remove the possibility of this deadlock by making the `BlockManagerMasterEndpoint` not block when responding to calls with `UpdateBlockInfo`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm edited a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
mridulm edited a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924492762


   Thanks for the jira and stack trace - that was really helpful !
   Looking at it more, the issue here is that we are relying on `BlockManagerMasterEndpoint` to update state in `MapOutputTracker` (which is usually done via `DAGScheduler`).
   
   Given there is no state mod for shuffle blocks when `UpdateBlockInfo` is received, it would simply be better to move just that codepath to a different thread - instead of trying to add fine grained locking for rest of `BlockManagerMasterEndpoint` (the change is insufficient to do that unfortunately).
   
   I am still testing locally, and making sure there are no issues - but the gist is:
   
   * `updateBlockInfo` returns `Future[Boolean]`
   * When `blockId` is a shuffle block - return a `Future { }` around the existing `blockId match`
   * For all other return in that method, use `Future.successful` to complete immediately.
   * As with the current PR, chain the future to return response.
   
   For shuffle blocks, it will should executed outside of the `BlockManagerMasterEndpoint`, while for the rest, it will get executed within the lock - and so no need to change rest of the state's MT safety.
   
   
   Thoughts ?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] attilapiros edited a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
attilapiros edited a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925124177


   Even the existing code shows this as when we talk about a shuffle block in the `updateBlockInfo` we return (in all the three branches below):
   
   https://github.com/apache/spark/blob/26b3b1118cc9701127c359b69b25ecf3a023c748/core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala#L582-L598


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
mridulm commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924357412


   Thanks for the details @eejbyfeldt, this makes sense ... this is an unfortunate side effect.
    Will take a look at the PR later.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925162972


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48018/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] Ngone51 commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
Ngone51 commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924638509


   > Looking at it more, the issue here is that we are relying on BlockManagerMasterEndpoint to update state in MapOutputTracker (which is usually done via DAGScheduler).
   
   Good point! So I think we can delegate the `UpdateBlockInfo` of migrated shuffle blocks to `DagScheduler` instead.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] attilapiros commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
attilapiros commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925126218


   This way the `dispatcher-BlockManagerMaster` thread will be avoided and it can handle the RPC calls which was the root of the problem.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] attilapiros edited a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
attilapiros edited a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925124177


   Even the existing code shows this as when we talk about a shuffle block in the `updateBlockInfo` as (in all the three branches) we return:
   
   https://github.com/apache/spark/blob/26b3b1118cc9701127c359b69b25ecf3a023c748/core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala#L582-L598


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] Ngone51 commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
Ngone51 commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925526769


   FYI: followup PR: https://github.com/apache/spark/pull/34076


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925163019


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/48018/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924877716


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48016/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924804715


   **[Test build #143506 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143506/testReport)** for PR 34043 at commit [`306fa17`](https://github.com/apache/spark/commit/306fa172c32a389faecd4fb1aeca9f9e2e44d884).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925128818


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48018/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] Ngone51 commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
Ngone51 commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925463156


   > Given there was no MT-safety reason to delegate to DAGScheduler, I was thinking along the lines of what @f-thiele's change : we already have other Future invocations in BlockManagerMasterEndpoint.
   
   I think delegating to DAGScheduler is an alternative way to decouple BlockManagerMasterEndpoint and MapOutputTracker, which should also work in this case. The current fix looks good to me after removing the read/write lock. I'll approve it to catch up 3.2 cut.
   
   > When looking at the affected codepaths, BlockManager is not currently differentiating between the block id's in tryToReportBlockStatus when it is updating driver (normal and for block migration).
   Until node decommissioning, this path was used for non-shuffle blocks iirc.
   >
   > IMO handling the shuffle vs non-shuffle split while processing UpdateBlockInfo at driver is cleaner than spreading it out to caller; unless we have other issues in doing so (for example: MT-safety, correctness, design hygine, etc concerns).
   Thoughts ?
   
   I actually think it's cleaner to spread it out at the caller. It's confused the shuffle blocks are handled specifically comparing to other blocks. Ideally, I think we should send the RPC msg (e.g., having a new message called `UpdatedShuffleBlockLocation`) to `MapOutputTrackerMasterEndpoint` directly.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924073797


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/47984/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924063690


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/47984/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924877750


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/48016/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924128528


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/143473/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] gengliangwang commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
gengliangwang commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925506883


   @mridulm @Ngone51 I really want to start 3.2.0 RC4 today.
   So I am going to merge this one and ask @Ngone51 to create a follow-up PR so that we can start the new RC soon.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] mridulm commented on a change in pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
mridulm commented on a change in pull request #34043:
URL: https://github.com/apache/spark/pull/34043#discussion_r714097032



##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -573,39 +576,41 @@ class BlockManagerMasterEndpoint(
       blockId: BlockId,
       storageLevel: StorageLevel,
       memSize: Long,
-      diskSize: Long): Boolean = {
+      diskSize: Long): Future[Boolean] = {
     logDebug(s"Updating block info on master ${blockId} for ${blockManagerId}")
 
     if (blockId.isShuffle) {
       blockId match {
         case ShuffleIndexBlockId(shuffleId, mapId, _) =>
           // We need to update this at index file because there exists the index-only block
           logDebug(s"Received shuffle index block update for ${shuffleId} ${mapId}, updating.")
-          mapOutputTracker.updateMapOutput(shuffleId, mapId, blockManagerId)
-          return true
+          return Future {
+            mapOutputTracker.updateMapOutput(shuffleId, mapId, blockManagerId)
+            true
+          }

Review comment:
       nit: Can we move the log statement into the future as well ? so that it is emitted just before invoking updateMapOutput.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] attilapiros edited a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
attilapiros edited a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925124177


   Even the existing code shows this as when we talk about a shuffle block in the `updateBlockInfo` (in all the three branches) we return:
   
   https://github.com/apache/spark/blob/26b3b1118cc9701127c359b69b25ecf3a023c748/core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala#L582-L598


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924918664


   **[Test build #143506 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/143506/testReport)** for PR 34043 at commit [`306fa17`](https://github.com/apache/spark/commit/306fa172c32a389faecd4fb1aeca9f9e2e44d884).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] attilapiros edited a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
attilapiros edited a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925126218


   This way (not delegating into `BlockManagerMasterEndpoint`) the `dispatcher-BlockManagerMaster` thread will be avoided and it can handle the RPC calls which was the root of the problem.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] f-thiele commented on a change in pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
f-thiele commented on a change in pull request #34043:
URL: https://github.com/apache/spark/pull/34043#discussion_r714116809



##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -573,39 +576,41 @@ class BlockManagerMasterEndpoint(
       blockId: BlockId,
       storageLevel: StorageLevel,
       memSize: Long,
-      diskSize: Long): Boolean = {
+      diskSize: Long): Future[Boolean] = {
     logDebug(s"Updating block info on master ${blockId} for ${blockManagerId}")
 
     if (blockId.isShuffle) {
       blockId match {
         case ShuffleIndexBlockId(shuffleId, mapId, _) =>
           // We need to update this at index file because there exists the index-only block
           logDebug(s"Received shuffle index block update for ${shuffleId} ${mapId}, updating.")
-          mapOutputTracker.updateMapOutput(shuffleId, mapId, blockManagerId)
-          return true
+          return Future {
+            mapOutputTracker.updateMapOutput(shuffleId, mapId, blockManagerId)
+            true
+          }

Review comment:
       :+1: done in 26b3b1118cc9701127c359b69b25ecf3a023c748




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] attilapiros commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
attilapiros commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925121266


   I do not think we have to delegate into `BlockManagerMasterEndpoint` at all.
   The block locations / block infos for about RDD and broadcast blocks for the shuffle blocks we only need to update the map output tracker.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-922543205


   Can one of the admins verify this patch?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924836423


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/48016/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] gengliangwang commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
gengliangwang commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925506975


   Merging to master/3.2


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-925232828


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/143508/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] Ngone51 edited a comment on pull request #34043: [SPARK-36782][CORE] Avoid blocking dispatcher-BlockManagerMaster during UpdateBlockInfo

Posted by GitBox <gi...@apache.org>.
Ngone51 edited a comment on pull request #34043:
URL: https://github.com/apache/spark/pull/34043#issuecomment-924860943


   > With the proposed changes I suppose we don't actually delegate it to the DAGScheduler (as suggested by @Ngone51) but to the block-manager-ask-thread-pool. If this is undesired, I believe there's a more fundamental change needed?
   
   @f-thiele  We can get the `dagScheduler` by `BlockManagerMasterEndpoint.listenerBus.sparkContext.dagScheduler` (should expose  `sparkContext` in `listenerBus` as `private[spark]` ) and add a new function in `dagScheduler` to handle the specific `UpdateBlockInfo` of migrated shuffle block. (You could follow `dagScheduler.executorAdded` as an example). So I actually don't expect much more fundamental changes here.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org