Skip to content

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

Open

Description

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)

Activity

  1. 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.`[/+] on Aug 20, 2018
  2. ssivaji-w commented on Jun 26, 2020

    @ssivaji-w

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions