Skip to content
Merged
Show file tree
Hide file tree
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 @@ -64,10 +64,6 @@ public StrategyPriority canHandle(Snapshot snapshot, SnapshotOperation op) {
return StrategyPriority.HIGHEST;
}

if (SnapshotOperation.DELETE.equals(op)) {
return StrategyPriority.HIGHEST;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

code LGTM, as delete op is not handled here, it shouldn't consider this strategy.

Copy link
Member

Choose a reason for hiding this comment

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

@sureshanaparti thanks for the code review. I would like to just add a note to avoid misunderstandings.

Delete operation for Ceph has always been supported by CephSnapshotStrategy due to the fact that the parent class of CephSnapshotStrategy is StorageSystemSnapshotStrategy, which handles the deletion of Ceph/RBD snapshots.

However, StorageSystemSnapshotStrategy does not handle backed snapshots via NFS in this context and when Ceph had features introduced the backup on secondary storage was not taken into account.

With the fix proposed by @slavkap, it was possible to check that nowadays DefaultSnapshotStrategy supports deletions of Snapshots on Ceph (with or without backup on NFS).

return StrategyPriority.CANT_HANDLE;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ private void configureAndVerifyCanHandle(Date removed, boolean isSnapshotStoredO
StrategyPriority strategyPriority = cephSnapshotStrategy.canHandle(snapshot, snapshotOps[i]);
if (snapshotOps[i] == SnapshotOperation.REVERT && isSnapshotStoredOnRbdStoragePool) {
Assert.assertEquals(StrategyPriority.HIGHEST, strategyPriority);
} else if (snapshotOps[i] == SnapshotOperation.DELETE && isSnapshotStoredOnRbdStoragePool) {
Assert.assertEquals(StrategyPriority.HIGHEST, strategyPriority);
} else {
Assert.assertEquals(StrategyPriority.CANT_HANDLE, strategyPriority);
}
Expand Down