-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix handling when there is no NextRowKey header #19891
Conversation
Thank you for your contribution @joelverhagen! We will review the pull request and get back to you soon. |
I was able to verify the fix by making a project reference to my cloned version of Azure.Data.Tables.csproj. I couldn't figure out how to run |
Hi @joelverhagen. Thank you for your continued efforts to help improve the Tables experience. I've looped @christothes in for his feedback. |
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.
Thanks for this PR! This is a great find.
I just left a few minor comments.
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.
👍
According to the Azure Table Storage documentation, the
x-ms-continuation-NextRowKey
header can be excluded when thex-ms-continuation-NextPartitionKey
is present. From my own usage of Azure Table Storage, this seems like a rare case but I encountered it.I believe it can happen when you have a very large/hot table that is split into multiple physical partitions. In such cases I have performed some range queries on
PartitionKey
that cause a bug in Azure.Data.Tables. There is improper handling of when theNextRowKey
header is missing.My repro code looks like this, but it only works sometimes (i.e. when the table is very large or active):
This will not repro on an empty or small table, from my tests. I even tried a repro where I put 100,000 entities each with an 8 KiB binary property. This didn't trigger the case. I am able to trigger it somewhat reliably with my ExplorePackages project.
But I don't think a repro is hugely important because the bug is clear from the code. When you split the continuation token:
by space and
{rk}
is null or an empty string,string.Split
returns two pieces, not one.This causes an exception when the second page is queries. The exception is:
The response from the first request looks like this (notice no row key response header):
The second request looks like this (notice an empty string row key header):
The error response is:
All SDK Contribution checklist:
This checklist is used to make sure that common guidelines for a pull request are followed.
Draft
mode if it is:General Guidelines and Best Practices
Testing Guidelines
SDK Generation Guidelines
*.csproj
andAssemblyInfo.cs
files have been updated with the new version of the SDK. Please double check nuget.org current release version.Additional management plane SDK specific contribution checklist:
Note: Only applies to
Microsoft.Azure.Management.[RP]
orAzure.ResourceManager.[RP]
Management plane SDK Troubleshooting
new service
label and/or contact assigned reviewer.Verify Code Generation
step, please ensure:generate.ps1/cmd
to generate this PR instead of callingautorest
directly.Please pay attention to the @microsoft.csharp version output after running generate.ps1. If it is lower than current released version (2.3.82), please run it again as it should pull down the latest version,
Old outstanding PR cleanup
Please note:
If PRs (including draft) has been out for more than 60 days and there are no responses from our query or followups, they will be closed to maintain a concise list for our reviewers.