hemantk-12 commented on code in PR #4678:
URL: https://github.com/apache/ozone/pull/4678#discussion_r1223346706
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java:
##########
@@ -481,7 +479,7 @@ private SnapshotDiffReportOzone createPageResponse(
private void checkReportsIntegrity(final SnapshotDiffJob diffJob,
final int totalDiffEntries)
throws IOException {
- if (diffJob.getTotalDiffEntries() != totalDiffEntries) {
+ if (diffJob.getTotalDiffEntries() > totalDiffEntries) {
Review Comment:
Ah, I see what you meant.
For that, we need to check that `index` passed by client is less than`
totalDiffEntries` in `createPageResponse` not here. This is very basic data
integrity to make sure that complete report was returned to client assuming
that client fetches whole report and not from in-between.
Check 439-444 is redundant since that already happens in
`OmSnapshotManager`. Change it to `if (index >=
snapDiffJob.getTotalDiffEntries)` and return empty response with null next
token instead of throwing an exception.
--
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]