-
Notifications
You must be signed in to change notification settings - Fork 29.1k
[SPARK-34054][CORE] BlockManagerDecommissioner code cleanup #31102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5759dc7
init
Ngone51 22ee11c
fix test
Ngone51 63ae60d
use option shuffleMigrationPool too
Ngone51 a93ffa2
remove redundant lines
Ngone51 e8efc25
revert to use ConcurrentLinkedQueue
Ngone51 4cdca0d
rename offload in BlockManagerSuite
Ngone51 4567842
rename to nextShuffleBlockToMigrate
Ngone51 f5647f3
sub-block
Ngone51 416baa7
improve the condition of delete file
Ngone51 16c643b
fix BlockManagerSuite
Ngone51 66e56b7
improve handling InterruptedException
Ngone51 4c8b28d
add comment
Ngone51 88a205e
fix test failure
Ngone51 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -296,8 +296,15 @@ private[spark] class CoarseGrainedExecutorBackend( | |
| logInfo(msg) | ||
| try { | ||
| decommissioned = true | ||
| if (env.conf.get(STORAGE_DECOMMISSION_ENABLED)) { | ||
| val migrationEnabled = env.conf.get(STORAGE_DECOMMISSION_ENABLED) && | ||
| (env.conf.get(STORAGE_DECOMMISSION_RDD_BLOCKS_ENABLED) || | ||
| env.conf.get(STORAGE_DECOMMISSION_SHUFFLE_BLOCKS_ENABLED)) | ||
| if (migrationEnabled) { | ||
| env.blockManager.decommissionBlockManager() | ||
| } else if (env.conf.get(STORAGE_DECOMMISSION_ENABLED)) { | ||
|
||
| logError(s"Storage decommissioning attempted but neither " + | ||
| s"${STORAGE_DECOMMISSION_SHUFFLE_BLOCKS_ENABLED.key} or " + | ||
| s"${STORAGE_DECOMMISSION_RDD_BLOCKS_ENABLED.key} is enabled ") | ||
| } | ||
| if (executor != null) { | ||
| executor.decommission() | ||
|
|
@@ -324,7 +331,7 @@ private[spark] class CoarseGrainedExecutorBackend( | |
| while (true) { | ||
| logInfo("Checking to see if we can shutdown.") | ||
| if (executor == null || executor.numRunningTasks == 0) { | ||
| if (env.conf.get(STORAGE_DECOMMISSION_ENABLED)) { | ||
| if (migrationEnabled) { | ||
| logInfo("No running tasks, checking migrations") | ||
| val (migrationTime, allBlocksMigrated) = env.blockManager.lastMigrationInfo() | ||
| // We can only trust allBlocksMigrated boolean value if there were no tasks running | ||
|
|
@@ -340,7 +347,7 @@ private[spark] class CoarseGrainedExecutorBackend( | |
| exitExecutor(0, ExecutorLossMessage.decommissionFinished, notifyDriver = true) | ||
| } | ||
| } else { | ||
| logInfo("Blocked from shutdown by running ${executor.numRunningtasks} tasks") | ||
| logInfo(s"Blocked from shutdown by ${executor.numRunningTasks} running tasks") | ||
| // If there is a running task it could store blocks, so make sure we wait for a | ||
| // migration loop to complete after the last task is done. | ||
| // Note: this is only advanced if there is a running task, if there | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the above lines does
STORAGE_DECOMMISSION_ENABLEDhas any role now?So what about removing this config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That‘s my concern too. But removal involves the API change. I intentionally try to avoid that in this refactor PR. But I still think it's worth a try in a separate PR, especially since the 3.1 hasn't released yet. cc @holdenk what's your opinion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kindly ping @holdenk