-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDDS-9983. Changed snapshot list API to return continuation token rather than using last element from the previous page's response. #6542
Conversation
…her than using last element from the previous page's response.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemantk-12 Thanks for the patch. I really like the the idea here, but I have a minor nitpicky comment on the response we are sending here. In my opinion sending a single boolean value should be sufficient to what we are trying to achieve here.
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
Show resolved
Hide resolved
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java
Show resolved
Hide resolved
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/snapshot/ListSnapshotResponse.java
Show resolved
Hide resolved
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/ObjectStore.java
Show resolved
Hide resolved
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/ObjectStore.java
Show resolved
Hide resolved
how does this behave in case of new server & old client or viceversa? |
I believe it should be backward compatible with client. Old client will work seemlessly in a sense it won't use the additional response. But newer client will not work with old server. @hemantk-12 we should ensure this, if the lastSnapshotResponse doesn't exist we should rely on the iterator's last key instead falling back to the original logic. |
Protobuf change 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 wrapper as @swamirishi mentioned. @swamirishi The better approach would be to set lastSnapshot (here) either when API has it in response or when list size is equal to maxListResult.
I made the change according to this. Let me know your thoughts. |
...n/java/org/apache/hadoop/ozone/om/protocolPB/OzoneManagerProtocolClientSideTranslatorPB.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thanks for the patch @hemantk-12 . From the changes we are reducing the extent of another OM request after the last page but we could be hitting another redundant OM request in the case mentioned in the comments. But anyhow we can go ahead with this change for now.
@hemantk-12 Do you want a review from someone else on this? Or else we can merge this. |
@ayushtkn do you want to give it another look? |
@hemantk-12 If you folks are convinced, feel free to merge, thanks for holding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemantk-12 overall code looks good other than existing comments
Thanks for the review @sumitagrawl. I've addressed or resolved most of the comments. Let me know if there is any compatibility break change otherwise, it should be good to merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemantk-12 LGTM
Thanks @swamirishi @sumitagrawl and @ayushtkn for the review. |
…her than using last element from the previous page's response. (apache#6542)
What changes were proposed in this pull request?
Currently, the last element from the current page's response is used as a continuation token for the list snapshot API. Because of that, every time a client has to make an extra call to know if there are more entries. This change is to return the continuation token from the server and the next page will be fetched after the provided token.
What is the link to the Apache JIRA
HDDS-9983
How was this patch tested?
Updated existing unit tests.