Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/14396#discussion_r72838556
--- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
@@ -1430,14 +1430,10 @@ class SparkContext(config: SparkConf) extends
Logging with ExecutorAllocationCli
schemeCorrectedPath
}
val timestamp = System.currentTimeMillis
- addedFiles(key) = timestamp
-
- // Fetch the file locally in case a job is executed using
DAGScheduler.runLocally().
- Utils.fetchFile(path, new File(SparkFiles.getRootDirectory()), conf,
env.securityManager,
- hadoopConfiguration, timestamp, useCache = false)
-
- logInfo("Added file " + path + " at " + key + " with timestamp " +
addedFiles(key))
- postEnvironmentUpdate()
+ if (addedFiles.putIfAbsent(key, timestamp).isEmpty) {
--- End diff --
Yeah, this is actually intentional. I experimented with implementing the
1.x behavior and started writing some tests to verify that newer versions of
files took precedence over old ones but then discovered that Spark executors
will crash with exceptions if they've downloaded a file with a given name and
the new file's contents don't match the old file. Given this behavior it seems
that updating the timestamp will work only if the new file has the same
contents as the old file (in which case it doesn't matter what we do with the
timestamp) or if all executors are replaced before running any further tasks
(which seems like an obscure use-case that we don't want to optimize for).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]