hemantk-12 commented on PR #6542:
URL: https://github.com/apache/ozone/pull/6542#issuecomment-2063048992

   > how does this behave in case of new server & old client or vice-versa?
   
   [Protobuf 
change](https://github.com/apache/ozone/pull/6542/files#diff-31e34e282f9c79c316ed42775ccba5aba01cf10771bf8954e72ccc1e87d04a62)
 is backward and forward compatible in itself.
   
   I think the only change which can break is forward compatibility (will fetch 
only one page) of 
[OzoneManagerProtocolClientSideTranslatorPB](https://github.com/apache/ozone/pull/6542/files#diff-325e3b09b6b288fb89c08b2d4ceba0e1ddddef0cb7f87e2dd005615814b658aaR1328)
 wrapper as @swamirishi mentioned.
   
   @swamirishi `If lastSnapshot doesn't exist in the response, we should rely 
on the iterator's last key instead falling back to the original logic` is not 
making any difference. I think it will defect the whole purpose of the change.
   
   The better approach would be to set lastSnapshot 
([here](https://github.com/apache/ozone/pull/6542/files#diff-325e3b09b6b288fb89c08b2d4ceba0e1ddddef0cb7f87e2dd005615814b658aaR1357))
 either when API has it in response or when list size is equal to maxListResult.
   
   ```
       ...
       ...
       String lastSnapshot = null;
   
       if (response.hasLastSnapshot()) {
         lastSnapshot = response.getLastSnapshot();
       } else if (snapshotInfos.size() == maxListResult) {
         // This is to make sure that the change (HDDS-9983) is forward 
compatibility.
         // Set lastSnapshot only when current list size is equal to 
maxListResult
         // and there is possibility of more entries.
         lastSnapshot = snapshotInfos.get(maxListResult - 1).getName();
       }
   
       return new ListSnapshotResponse(snapshotInfos, lastSnapshot);
   ```
   I made the change according to this. Let me know your thoughts. 


-- 
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]

Reply via email to