-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-38909][BUILD][CORE][YARN][FOLLOWUP] Make some code cleanup related to shuffle state db #37648
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
[SPARK-38909][BUILD][CORE][YARN][FOLLOWUP] Make some code cleanup related to shuffle state db #37648
Changes from 16 commits
579956e
2caffd1
87c42dd
e3500cf
86681e3
7e3befa
6ceb2d0
11b9dad
8b77b61
3e59b7b
7a22aeb
9449457
1f3b62b
ec370e7
11850af
024ec63
c8ac7e4
33c96a6
a5df1c4
dfe7ce5
6c91380
8f47c15
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -125,16 +125,13 @@ public ShuffleIndexInformation load(String filePath) throws IOException { | |
| .weigher((Weigher<String, ShuffleIndexInformation>) | ||
| (filePath, indexInfo) -> indexInfo.getRetainedMemorySize()) | ||
| .build(indexCacheLoader); | ||
| DBBackend dbBackend = null; | ||
| if (registeredExecutorFile != null) { | ||
| String dbBackendName = | ||
| conf.get(Constants.SHUFFLE_SERVICE_DB_BACKEND, DBBackend.LEVELDB.name()); | ||
| dbBackend = DBBackend.byName(dbBackendName); | ||
| logger.info("Configured {} as {} and actually used value {}", | ||
| Constants.SHUFFLE_SERVICE_DB_BACKEND, dbBackendName, dbBackend); | ||
| } | ||
| String dbBackendName = | ||
| conf.get(Constants.SHUFFLE_SERVICE_DB_BACKEND, DBBackend.LEVELDB.name()); | ||
| DBBackend dbBackend = DBBackend.byName(dbBackendName); | ||
| db = DBProvider.initDB(dbBackend, this.registeredExecutorFile, CURRENT_VERSION, mapper); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Review note: Recovery need not be enabled for node managers - in which case
So the main change in this file and |
||
| if (db != null) { | ||
| logger.info("Use {} as the implementation of {}", | ||
| dbBackend, Constants.SHUFFLE_SERVICE_DB_BACKEND); | ||
| executors = reloadRegisteredExecutors(db); | ||
| } else { | ||
| executors = Maps.newConcurrentMap(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -21,13 +21,13 @@ import java.nio.channels.FileChannel | |||||||||||||||||||||||||||||||||||||||||||||||
| import java.util.List | ||||||||||||||||||||||||||||||||||||||||||||||||
| import java.util.concurrent.ConcurrentMap | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| import com.fasterxml.jackson.databind.ObjectMapper | ||||||||||||||||||||||||||||||||||||||||||||||||
| import org.apache.hadoop.yarn.api.records.ApplicationId | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| import org.apache.spark.network.shuffle.ExternalShuffleBlockResolver.AppExecId | ||||||||||||||||||||||||||||||||||||||||||||||||
| import org.apache.spark.network.shuffle.RemoteBlockPushResolver._ | ||||||||||||||||||||||||||||||||||||||||||||||||
| import org.apache.spark.network.shuffle.protocol.{ExecutorShuffleInfo, FinalizeShuffleMerge} | ||||||||||||||||||||||||||||||||||||||||||||||||
| import org.apache.spark.network.shuffledb.DB | ||||||||||||||||||||||||||||||||||||||||||||||||
| import org.apache.spark.network.shuffledb.DBBackend | ||||||||||||||||||||||||||||||||||||||||||||||||
| import org.apache.spark.network.shuffledb.{DB, DBBackend, StoreVersion} | ||||||||||||||||||||||||||||||||||||||||||||||||
| import org.apache.spark.network.util.{DBProvider, TransportConf} | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -208,9 +208,12 @@ object ShuffleTestAccessor { | |||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| def reloadRegisteredExecutors( | ||||||||||||||||||||||||||||||||||||||||||||||||
| dbBackend: DBBackend, | ||||||||||||||||||||||||||||||||||||||||||||||||
| file: File): ConcurrentMap[ExternalShuffleBlockResolver.AppExecId, ExecutorShuffleInfo] = { | ||||||||||||||||||||||||||||||||||||||||||||||||
| val db = DBProvider.initDB(dbBackend, file) | ||||||||||||||||||||||||||||||||||||||||||||||||
| dbBackend: DBBackend, | ||||||||||||||||||||||||||||||||||||||||||||||||
| file: File, | ||||||||||||||||||||||||||||||||||||||||||||||||
| version: StoreVersion, | ||||||||||||||||||||||||||||||||||||||||||||||||
| mapper: ObjectMapper) | ||||||||||||||||||||||||||||||||||||||||||||||||
| : ConcurrentMap[ExternalShuffleBlockResolver.AppExecId, ExecutorShuffleInfo] = { | ||||||||||||||||||||||||||||||||||||||||||||||||
| val db = DBProvider.initDB(dbBackend, file, version, mapper) | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a behavior change for test, right (this ?)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lines 155 to 170 in 19b1780
Do you mean the behavior change is
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the original case does not test the For the spark/common/network-common/src/main/java/org/apache/spark/network/util/LevelDBProvider.java Lines 88 to 94 in 19b1780
For the
For
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mridulm any suggestions?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @squito or @tgravescs should have more context about this, and comment better - looking at the test, I would expect this test code path to additionally test if the DB is missing/invalid/etc and fail in case there is any issues (due to lack of error handling/fallback in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mridulm add SPARK-40364 to tracking this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will give a separately pr to continue to explore the feasibility about this change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry didn't get a chance to look before your filed the other issue, happy to look if you make the change under the other issue
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @tgravescs , I will give another pr later ~ |
||||||||||||||||||||||||||||||||||||||||||||||||
| val result = ExternalShuffleBlockResolver.reloadRegisteredExecutors(db) | ||||||||||||||||||||||||||||||||||||||||||||||||
| db.close() | ||||||||||||||||||||||||||||||||||||||||||||||||
| result | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,15 +45,14 @@ import org.apache.spark.SecurityManager | |
| import org.apache.spark.SparkFunSuite | ||
| import org.apache.spark.internal.config._ | ||
| import org.apache.spark.network.server.BlockPushNonFatalFailure | ||
| import org.apache.spark.network.shuffle.{MergedShuffleFileManager, NoOpMergedShuffleFileManager, RemoteBlockPushResolver, ShuffleTestAccessor} | ||
| import org.apache.spark.network.shuffle.{Constants, MergedShuffleFileManager, NoOpMergedShuffleFileManager, RemoteBlockPushResolver, ShuffleTestAccessor} | ||
| import org.apache.spark.network.shuffle.RemoteBlockPushResolver._ | ||
| import org.apache.spark.network.shuffle.protocol.ExecutorShuffleInfo | ||
| import org.apache.spark.network.shuffledb.DBBackend | ||
| import org.apache.spark.network.util.TransportConf | ||
| import org.apache.spark.network.yarn.util.HadoopConfigProvider | ||
| import org.apache.spark.tags.ExtendedLevelDBTest | ||
| import org.apache.spark.util.Utils | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
| abstract class YarnShuffleServiceSuite extends SparkFunSuite with Matchers { | ||
|
|
||
| private[yarn] var yarnConfig: YarnConfiguration = null | ||
|
|
@@ -1068,6 +1067,8 @@ abstract class YarnShuffleServiceSuite extends SparkFunSuite with Matchers { | |
|
|
||
| test("create remote block push resolver instance") { | ||
| val mockConf = mock(classOf[TransportConf]) | ||
| when(mockConf.get(Constants.SHUFFLE_SERVICE_DB_BACKEND, DBBackend.LEVELDB.name())) | ||
| .thenReturn(shuffleDBBackend().name()) | ||
| when(mockConf.mergedShuffleFileManagerImpl).thenReturn( | ||
| "org.apache.spark.network.shuffle.RemoteBlockPushResolver") | ||
| val mergeMgr = YarnShuffleService.newMergedShuffleFileManagerInstance(mockConf, null) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.