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

Large sql query crash on partitioned collection #106

Open
ytaous opened this issue Apr 25, 2018 · 4 comments
Open

Large sql query crash on partitioned collection #106

ytaous opened this issue Apr 25, 2018 · 4 comments

Comments

@ytaous
Copy link

ytaous commented Apr 25, 2018

For example:
SELECT c.id, c.keywords FROM UserData c WHERE c.id IN (key1, ke2, …., key800)
where the id is the partitioned key when I created the collection with "unlimited" storage capacity
Using documentClient to query the table, it crashes with EXCEPTION_ACCESS_VIOLATION.
Same code works fine if I query a collection that was created with "10GB" limit without any partition.
Here is the exaception details:

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.microsoft.azure.documentdb.internal.ServiceJNIWrapper.GetPartitionKeyRangesFromQuery(JLjava/lang/String;[Ljava/lang/String;[IIILjava/lang/StringBuilder;ILcom/microsoft/azure/documentdb/internal/ServiceJNIWrapper$IntWrapper;)J+0
j com.microsoft.azure.documentdb.internal.ServiceJNIWrapper.getSerializedPartitionKeyRangesFromQuery(JLcom/microsoft/azure/documentdb/SqlQuerySpec;Lcom/microsoft/azure/documentdb/PartitionKeyDefinition;)Ljava/lang/String;+218
j com.microsoft.azure.documentdb.internal.ServiceJNIWrapper.getPartitionKeyRangesFromQuery(JLcom/microsoft/azure/documentdb/SqlQuerySpec;Lcom/microsoft/azure/documentdb/PartitionKeyDefinition;)Lcom/microsoft/azure/documentdb/internal/query/PartitionedQueryExecutionInfoInternal;+3
j com.microsoft.azure.documentdb.internal.query.QueryPartitionProvider.getPartitionQueryExcecutionInfo(Lcom/microsoft/azure/documentdb/SqlQuerySpec;Lcom/microsoft/azure/documentdb/PartitionKeyDefinition;)Lcom/microsoft/azure/documentdb/internal/query/PartitionedQueryExecutionInfo;+48
j com.microsoft.azure.documentdb.internal.query.ProxyQueryExecutionContext.(Lcom/microsoft/azure/documentdb/DocumentQueryClientInternal;Lcom/microsoft/azure/documentdb/internal/ResourceType;Ljava/lang/Class;Lcom/microsoft/azure/documentdb/SqlQuerySpec;Lcom/microsoft/azure/documentdb/FeedOptionsBase;Ljava/lang/String;)V+158
j com.microsoft.azure.documentdb.internal.query.QueryExecutionContextFactory.createQueryExecutionContext(Lcom/microsoft/azure/documentdb/DocumentQueryClientInternal;Lcom/microsoft/azure/documentdb/internal/ResourceType;Ljava/lang/Class;Lcom/microsoft/azure/documentdb/SqlQuerySpec;Lcom/microsoft/azure/documentdb/FeedOptionsBase;Ljava/lang/String;)Lcom/microsoft/azure/documentdb/internal/query/QueryExecutionContext;+12
j com.microsoft.azure.documentdb.QueryIterable.createQueryExecutionContext(Lcom/microsoft/azure/documentdb/DocumentClient;Lcom/microsoft/azure/documentdb/internal/ResourceType;Ljava/lang/Class;Ljava/lang/String;Lcom/microsoft/azure/documentdb/SqlQuerySpec;Lcom/microsoft/azure/documentdb/FeedOptionsBase;Ljava/lang/Object;)Lcom/microsoft/azure/documentdb/internal/query/QueryExecutionContext;+70
j com.microsoft.azure.documentdb.QueryIterable.reset()V+30
j com.microsoft.azure.documentdb.QueryIterable.(Lcom/microsoft/azure/documentdb/DocumentClient;Lcom/microsoft/azure/documentdb/internal/ResourceType;Ljava/lang/Class;Ljava/lang/String;Lcom/microsoft/azure/documentdb/SqlQuerySpec;Lcom/microsoft/azure/documentdb/FeedOptionsBase;Ljava/lang/Object;)V+58
j com.microsoft.azure.documentdb.DocumentClient.queryDocuments(Ljava/lang/String;Lcom/microsoft/azure/documentdb/SqlQuerySpec;Lcom/microsoft/azure/documentdb/FeedOptions;Ljava/lang/Object;)Lcom/microsoft/azure/documentdb/FeedResponse;+84
j com.microsoft.azure.documentdb.DocumentClient.queryDocuments(Ljava/lang/String;Ljava/lang/String;Lcom/microsoft/azure/documentdb/FeedOptions;Ljava/lang/Object;)Lcom/microsoft/azure/documentdb/FeedResponse;+48
j com.microsoft.azure.documentdb.DocumentClient.queryDocuments(Ljava/lang/String;Ljava/lang/String;Lcom/microsoft/azure/documentdb/FeedOptions;)Lcom/microsoft/azure/documentdb/FeedResponse;+5

@moderakh
Copy link
Contributor

@ytaous Thanks for reporting the issue. Could you please let us know which version of SDK you are using?

@ytaous
Copy link
Author

ytaous commented Apr 25, 2018

v. 1.16.0 , it's pretty easy to reproduce using your sample test code - simpleDocumentQuery. Change that to compose IN clause with 400 keys, and do the query against any partitioned collection. The collection could be empty. Then you can compare the same against non-partitioned collection.

BTY, Java SDK is 1.8. I am using Intellij.

@ytaous
Copy link
Author

ytaous commented Apr 25, 2018

BTY, we also perform C# test with the same logic, it works fine.

@abaeteman
Copy link

Hey there !

We have a similar error (ACCESS_VIOLATION) running a large query with the latest version (2.1.1).
Note that the error is not reproduced if we use the async connector (https://github.com/Azure/azure-cosmosdb-java) with the same request.

Any updates on this problem ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants