-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-48586][SS] Remove lock acquisition in doMaintenance() by making a deep copy of file mappings in RocksDBFileManager in load() #46942
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
Closed
riyaverm-db
wants to merge
18
commits into
apache:master
from
riyaverm-db:remove-lock-contention-between-maintenance-and-task
Closed
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
b8bf6cc
Add deepCopy() to RocksDBFileManager
riyaverm-db d9cfc70
Add deepCopy test case
riyaverm-db 1b64014
Fix Formatting
riyaverm-db 28451ca
Revert pr changes
riyaverm-db a995091
Use deepCopy to avoid lock contention
riyaverm-db 25b9e96
Modify deep copy test case, add comments
riyaverm-db d3cbf25
Add additional asserts to deepCopy test case
riyaverm-db 0bf9acd
Add lock contention test case
riyaverm-db 6069779
Add latestSnapshot race condition test case
riyaverm-db 7381b17
Modify test case comments
riyaverm-db 651ac74
Move lock contention test case
riyaverm-db d3354cf
Modify lock test case
riyaverm-db 7b4ebd6
Remove latestSnapshot race condition and refactor RocksDBFileManager …
riyaverm-db c57f958
Purge oldSnapshots one at a time
riyaverm-db ddb97d6
Minor code style and naming changes
riyaverm-db 5894a97
Add synchronization in commit to remove latestSnapshot race condition
riyaverm-db bcb2307
Remove Option in list type
riyaverm-db 16c26fc
Remove extra line
riyaverm-db File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Revert pr changes
- Loading branch information
commit 28451ca8c8f91f10eb6d67517c6d23ad72c88ced
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we trying to synchronize updates between task thread/maintenance thread here? If so, we need a lock - just synchronized would not work. This code can only be executed by one thread anyways (task thread that holds the acquire lock - so synchronized does not do anything in my opinion).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the race condition you are thinking about? Is calling close() on a snapshot being uploaded? In that case we can defer the close to the maintenance thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I missed your comment @chaoqin-li1123. The race condition is basically assigning to latestSnapshot variable. We assign the value of variable to newly created snapshot here, and set the variable to None in maintenance thread. Both these need to be synchronized, I think.
It seems to have been fixed in the latest revision.