[SPARK-56966][SPARK-56967][CORE] Auto-create event log and history se…#56029
Closed
sharma-0311 wants to merge 1 commit into
Closed
[SPARK-56966][SPARK-56967][CORE] Auto-create event log and history se…#56029sharma-0311 wants to merge 1 commit into
sharma-0311 wants to merge 1 commit into
Conversation
…rver log directories if they do not exist - FsHistoryProvider: when spark.history.fs.logDirectory does not exist, attempt to create it automatically via FileSystem.mkdirs instead of immediately failing. Falls back to a warning if creation fails. - EventLogFileWriters: in requireLogBaseDirAsDirectory(), check for directory existence before getFileStatus and auto-create via FileSystem.mkdirs if missing. This prevents FileNotFoundException when spark.eventLog.dir (including S3 paths) has not been pre-created.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes were proposed in this pull request?
Auto-create
spark.eventLog.dirandspark.history.fs.logDirectoryatstartup if they do not exist, instead of failing with a FileNotFoundException.
FsHistoryProvider (SPARK-56966): In
startPolling(), theFileNotFoundException catch block now calls
FileSystem.mkdirsbeforegiving up. If creation succeeds the directory is treated as valid; if it
fails, the original warning-and-skip behavior is preserved.
EventLogFileWriters (SPARK-56967):
requireLogBaseDirAsDirectory()now checks
fileSystem.existsfirst and callsFileSystem.mkdirsif thepath is absent. Works for local FS, HDFS, and S3-compatible paths.
Why are the changes needed?
Users frequently hit startup failures because the log directory has not
been pre-created, even when the path and permissions are correct.
Auto-creating it reduces operational friction with no regression for
directories that already exist.
Does this PR introduce any user-facing change?
Yes — previously both code paths failed on a missing directory. Now they
create it automatically. Behavior is unchanged when the directory exists.
How was this patch tested?
Updated FsHistoryProviderSuite and EventLogFileWritersSuite with tests
covering the auto-creation path.
Resolves https://issues.apache.org/jira/browse/SPARK-56966
Resolves https://issues.apache.org/jira/browse/SPARK-56967