prashantpogde commented on code in PR #4491:
URL: https://github.com/apache/ozone/pull/4491#discussion_r1175662261
##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneClientAdapterImpl.java:
##########
@@ -646,4 +653,56 @@ public String createSnapshot(String pathStr, String
snapshotName)
ofsPath.getBucketName(),
snapshotName);
}
+
+ @Override
+ public SnapshotDiffReport getSnapshotDiffReport(Path snapshotDir,
+ String fromSnapshot, String toSnapshot)
+ throws IOException, InterruptedException {
+ boolean takeTemporarySnapshot = false;
+ if (toSnapshot.equals(ACTIVE_FS_SNAPSHOT_NAME)) {
+ takeTemporarySnapshot = true;
+ toSnapshot = createSnapshot(snapshotDir.toString(),
+ "temp" + SnapshotInfo.generateName(Time.now()));
+ }
+ try {
+ SnapshotDiffReportOzone aggregated;
+ SnapshotDiffReportOzone report =
+ getSnapshotDiffReportOnceComplete(fromSnapshot, toSnapshot, "");
+ aggregated = report;
+ while (!report.getToken().isEmpty()) {
+ LOG.info(
+ "Total Snapshot Diff length between snapshot {} and {} exceeds"
+ + " max page size, Performing another " +
+ "snapdiff with index at {}",
+ fromSnapshot, toSnapshot, report.getToken());
+ report = getSnapshotDiffReportOnceComplete(fromSnapshot, toSnapshot,
+ report.getToken());
+ aggregated.aggregate(report);
+ }
+ return aggregated;
+ } finally {
+ // delete the temp snapshot
+ if (takeTemporarySnapshot) {
+ OFSPath snapPath = new OFSPath(snapshotDir.toString(), config);
+ ozoneClient.getObjectStore()
+ .deleteSnapshot(snapPath.getVolumeName(), snapPath.getBucketName(),
Review Comment:
Temp snapshots should not be part of Garbage collection on their own. We
need to have a separate service to issue deletes on the temporary snapshots.
This can be a separate Jira and a separte PR.
I have filed https://issues.apache.org/jira/browse/HDDS-8483 to track 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]