-
Notifications
You must be signed in to change notification settings - Fork 594
HDDS-14015. Delete older snapshot checkpoint dirs under the snapshot content lock #9380
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -613,10 +613,10 @@ private boolean checkAndDefragSnapshot(SnapshotChainManager chainManager, UUID s | |
| checkpointMetadataManager = null; | ||
| // Switch the snapshot DB location to the new version. | ||
| previousVersion = atomicSwitchSnapshotDB(snapshotId, checkpointLocation); | ||
| omSnapshotManager.deleteSnapshotCheckpointDirectories(snapshotId, previousVersion); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Title doesn't correctly reflect the change?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The title should be:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
| } finally { | ||
| snapshotContentLocks.releaseLock(); | ||
| } | ||
| omSnapshotManager.deleteSnapshotCheckpointDirectories(snapshotId, previousVersion); | ||
| } finally { | ||
| if (checkpointMetadataManager != null) { | ||
| checkpointMetadataManager.close(); | ||
|
|
||
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.
Question -- if deleteSnapshotCheckpointDirectories() here needs to be protected inside a snapshot content lock, do we need to have snapshot content lock too in OMSnapshotPurgeResponse? deleteSnapshotCheckpointDirectories() is invoked there too.
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.
No we don't need SnapshotContentLock in purge as the snapshot is already going to deleted. DeleteSnapshotCheckpointDirectories would acquire snapshot db lock and ensure all handles for existing db and evict the instance from the cache altogether. This would ensure before another thread picks up the snapshot for writing we always pick the newest instance that we have moved.
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.
ok got it.