[SPARK-56966][SPARK-56967][CORE] Auto-create event log and history se…#56028
Closed
sharma-0311 wants to merge 2 commits into
Closed
[SPARK-56966][SPARK-56967][CORE] Auto-create event log and history se…#56028sharma-0311 wants to merge 2 commits into
sharma-0311 wants to merge 2 commits 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.
…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 the event log directory (
spark.eventLog.dir) and thehistory server log directory (
spark.history.fs.logDirectory) if theydo not exist at startup, instead of failing with a
FileNotFoundException.FsHistoryProvider (
SPARK-56966): InstartPolling(), theFileNotFoundExceptioncatch block now callsFileSystem.mkdirswithLOG_FOLDER_PERMISSIONSbefore giving up. If creation succeeds thedirectory 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. This works for local FS, HDFS, and S3-compatible paths.
Why are the changes needed?
Users frequently see startup failures because the log directory has not
been pre-created, even when the path and permissions are otherwise correct.
Auto-creating it reduces operational friction with no behavioral regression
for directories that already exist.
Does this PR introduce any user-facing change?
Yes — previously both code paths threw/warned on a missing directory.
Now they silently create it. The behavior when a directory exists is
unchanged.
How was this patch tested?
FsHistoryProviderSuitecovering the new mkdir pathEventLogFileWritersSuitecovering auto-creationCloses #
Resolves https://issues.apache.org/jira/browse/SPARK-56966
Resolves https://issues.apache.org/jira/browse/SPARK-56967