Skip to content
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 to handle collisions in the effective partition key #21078

Merged
merged 2 commits into from
Apr 30, 2021

Conversation

mbhaskar
Copy link
Member

@mbhaskar mbhaskar commented Apr 30, 2021

There was a bug where the SDK could not handle collisions in the effective partition key. Normally this is pretty much impossible, since the epk is 128, but in HashV1 we only hash the first 100 bytes. This means any two strings with the same large prefix will collide. This collision caused an assertion error (the query ranges were not sorted and non-overlapping (because there was a perfect overlap)).

The client now puts all the ranges into a sorted set to avoid this issue.

Corresponding .NET PR Azure/azure-cosmos-dotnet-v3#835

Fixes #19911

@mbhaskar
Copy link
Member Author

/azp run java - cosmos - ci

@mbhaskar
Copy link
Member Author

/azp run java - cosmos - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mbhaskar
Copy link
Member Author

/azp run java - cosmos - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mbhaskar
Copy link
Member Author

/azp run java - cosmos - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@moderakh moderakh left a comment

Choose a reason for hiding this comment

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

thanks. LGTM.

Copy link
Member

@kushagraThapar kushagraThapar left a comment

Choose a reason for hiding this comment

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

LGTM

@mbhaskar mbhaskar merged commit e7d4c40 into Azure:master Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Cosmos DB] "sortedRanges" exception when querying Unique Key IN list
3 participants