swamirishi commented on code in PR #5040:
URL: https://github.com/apache/ozone/pull/5040#discussion_r2507898600
##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java:
##########
@@ -1318,11 +1314,21 @@ public void deleteSnapshot(String pathStr, String
snapshotName)
public SnapshotDiffReport getSnapshotDiffReport(Path snapshotDir,
String fromSnapshot, String toSnapshot)
throws IOException, InterruptedException {
- boolean takeTemporarySnapshot = false;
- if (toSnapshot.equals(ACTIVE_FS_SNAPSHOT_NAME)) {
- takeTemporarySnapshot = true;
+ boolean takeTemporaryToSnapshot = false;
+ boolean takeTemporaryFromSnapshot = false;
+ if (toSnapshot.isEmpty()) {
+ // empty toSnapshot implies diff b/w the fromSnapshot &
+ // current state.
+ takeTemporaryToSnapshot = true;
toSnapshot = createSnapshot(snapshotDir.toString(),
- "temp" + SnapshotInfo.generateName(Time.now()));
+ OzoneFSUtils.generateUniqueTempSnapshotName());
+ }
+ if (fromSnapshot.isEmpty()) {
+ // empty fromSnapshot implies diff b/w the current state
Review Comment:
@sadanand48 we don't support snapshot diff b/w snapshots where fromSnapshot
is more recent than toSnapshot? Is there a use case for this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]