Skip to content

Conversation

@hemantk-12
Copy link
Contributor

What changes were proposed in this pull request?

Currently, we print empty line if snapshot diff entry list is empty because continuation token more than the total diff entries. This change is to throw an IOException if continuation token for snapshot diff is more than the total diff entries. Also updated the response printing if DiffEntryList is empty.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-9360

How was this patch tested?

Updated integ tests and also checked the response on docker.

sh-4.2$ ozone sh volume create vol1
sh-4.2$ ozone sh bucket create vol1/bucket1
sh-4.2$ ozone sh key put vol1/bucket1/key1 README.md
sh-4.2$ ozone sh snapshot create vol1/bucket1 snap1
sh-4.2$ ozone sh key put vol1/bucket1/key2 README.md
sh-4.2$ ozone sh key put vol1/bucket1/key3 README.md
sh-4.2$ ozone sh key put vol1/bucket1/key4 README.md
sh-4.2$ ozone sh key put vol1/bucket1/key5 README.md
sh-4.2$ ozone sh snapshot create vol1/bucket1 snap2
sh-4.2$ ozone sh snapshot snapshotDiff vol1/bucket1 snap1 snap2
Snapshot diff job is IN_PROGRESS. Please retry after 60000 ms.
sh-4.2$ ozone sh snapshot snapshotDiff vol1/bucket1 snap1 snap2
Difference between snapshot: snap1 and snapshot: snap2
+       ./key2
+       ./key3
+       ./key4
+       ./key5
sh-4.2$ ozone sh snapshot diff  -t 150 vol1/bucket1 snap1 snap2  
INTERNAL_ERROR Index (given: 150) should be a number >= 0 and < totalDiffEntries: 4. Page size (given: 1000) should be a positive number > 0.
sh-4.2$ ozone sh snapshot diff  -t 4 vol1/bucket1 snap1 snap2
Difference between snapshot: snap1 and snapshot: snap2
No diff or no more diff for with the request parameters.

sh-4.2$ ozone sh snapshot diff  -t 2 vol1/bucket1 snap1 snap2
Difference between snapshot: snap1 and snapshot: snap2
+       ./key4
+       ./key5

@hemantk-12 hemantk-12 added the snapshot https://issues.apache.org/jira/browse/HDDS-6517 label Nov 29, 2023
Copy link
Contributor

@swamirishi swamirishi left a comment

Choose a reason for hiding this comment

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

Thanks for the patch @hemantk-12 LGTM

@hemantk-12 hemantk-12 merged commit 38dc524 into apache:master Nov 29, 2023
@hemantk-12
Copy link
Contributor Author

Thanks for the review @swamirishi

swamirishi pushed a commit to swamirishi/ozone that referenced this pull request Jun 10, 2024
… snapshot diff is more than the total diff entries (apache#5697)

(cherry picked from commit 38dc524)
Change-Id: Ie59de7ab1832ac8fb3d36fb58499a2a3fdefb4b2
@hemantk-12 hemantk-12 deleted the HDDS-9360 branch October 28, 2024 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

snapshot https://issues.apache.org/jira/browse/HDDS-6517

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants