Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok got it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Title doesn't correctly reflect the change?

Copy link
Contributor

@smengcl smengcl Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The title should be:

Delete older snapshot checkpoint dirs under the snapshot content lock

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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();
Expand Down