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

Query same collection after delete will fail with the requested resource is no longer available at the server. #118

Open
Incarnation-p-lee opened this issue Aug 20, 2018 · 1 comment

Comments

@Incarnation-p-lee
Copy link

When create the database with collection somewhat like /dbs/testdb/colls/testcolls, it will throw following exception of resource unavailable from SDK side.

Consider the pseudo code in below

  1. create database and collection, then insert and query.
  2. delete the collection
  3. create the collection with the same name
  4. insert and query.
        createDatabase();
        createCollection();
        insertAndQuery();

        deleteCollection();
        createCollection();


        LOGGER.info("Sleep 10 seconds");
        Thread.sleep(10000);
        LOGGER.info("Sleep 10 seconds finished");

        insertAndQuery();

        deleteDatabase(); 
java.lang.IllegalStateException: com.microsoft.azure.documentdb.DocumentClientException: Message: {"Errors":["The requested resource is no longer available at the server."]}
ActivityId: c93d9967-29f3-4d12-b3b0-630140779e43, Request URI: /apps/c2d19637-ce94-4a48-90d4-9238c827330e/services/107bff02-f7ab-4d80-96ad-b176d75edf85/partitions/4d3066d9-fb56-437f-8439-a51b0e96e987/replicas/131792032246807108s/, RequestStats: 
ResponseTime: 2018-08-20T02:51:13.9627192Z, StoreReadResult: StorePhysicalAddress: rntbd://bz6prdapp02-docdb-1.documents.azure.com:14045/apps/c2d19637-ce94-4a48-90d4-9238c827330e/services/107bff02-f7ab-4d80-96ad-b176d75edf85/partitions/4d3066d9-fb56-437f-8439-a51b0e96e987/replicas/131792032246807108s/, LSN: 7, GlobalCommittedLsn: 7, PartitionKeyRangeId: , IsValid: True, StatusCode: 0, IsGone: True, IsNotFound: False, IsInvalidPartition: True, RequestCharge: 0, ItemLSN: -1, ResourceType: Document, OperationType: Query
, SDK: Microsoft.Azure.Documents.Common/2.0.0.0, StatusCode: InvalidPartition

	at com.microsoft.azure.documentdb.internal.query.DefaultQueryExecutionContext.next(DefaultQueryExecutionContext.java:83)
	at com.microsoft.azure.documentdb.internal.query.DefaultQueryExecutionContext.next(DefaultQueryExecutionContext.java:33)
	at com.microsoft.azure.documentdb.internal.query.ProxyQueryExecutionContext.<init>(ProxyQueryExecutionContext.java:68)
	at com.microsoft.azure.documentdb.internal.query.QueryExecutionContextFactory.createQueryExecutionContext(QueryExecutionContextFactory.java:23)
	at com.microsoft.azure.documentdb.QueryIterable.createQueryExecutionContext(QueryIterable.java:70)
	at com.microsoft.azure.documentdb.QueryIterable.reset(QueryIterable.java:115)
	at com.microsoft.azure.documentdb.QueryIterable.<init>(QueryIterable.java:57)
	at com.microsoft.azure.documentdb.DocumentClient.queryDocuments(DocumentClient.java:1184)
	at com.microsoft.azure.documentdb.DocumentClient.queryDocuments(DocumentClient.java:1155)
@Incarnation-p-lee Incarnation-p-lee changed the title Query same collection after delete will fail with he requested resource is no longer available at the server. Query same collection after delete will fail with the requested resource is no longer available at the server. Aug 20, 2018
@ssivaji-w
Copy link

What's the solution identified for this issue?

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

2 participants