[SPARK-56044][CORE] HistoryServerDiskManager does not delete app store on release when app is not in active map#54877
Open
sl3635 wants to merge 1 commit intoapache:masterfrom
Open
[SPARK-56044][CORE] HistoryServerDiskManager does not delete app store on release when app is not in active map#54877sl3635 wants to merge 1 commit intoapache:masterfrom
sl3635 wants to merge 1 commit intoapache:masterfrom
Conversation
…e on release when app is not in active map
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?
HistoryServerDiskManager.release()skips the store directory deletion when the application is not present in the in-memoryactivemap. This happens because the directory operation is nested inside anoldSizeOpt.foreachblock, which only executes when the app was actively tracked.The
activemap is in-memory only and is empty after a History Server restart. When log expiration triggersrelease(delete=true)for an app that was never reopened after a restart, the on-disk store directory (.ldb/.rdb) is never deleted, causing orphaned store directories to accumulate indefinitely.This PR separates the
updateUsagededuction (which applies only to actively tracked apps) from the directory operation (which should apply whenever the directory exists on disk). When deleting an app not in the active map, its size is derived directly from disk before deduction to keep usage accounting accurate.Why are the changes needed?
Without this fix, orphaned
.ldb/.rdbstore directories are never cleaned up after a History Server restart, causing unbounded disk usage growth.Does this PR introduce any user-facing change?
No.
How was this patch tested?
Added a new test
SPARK-56044: release with delete cleans up store when app is not in active mapinHistoryServerDiskManagerSuitethat simulates a History Server restart and verifies thatrelease(delete=true)correctly deletes the store directory, removes the listing entry, and zeroes out usage accounting when the app is not in the active map.