Azure / Azure/azure-sdk-for-java
[BUG]Request fail with 400/1024 when container is re-created with same name
- Dominant language
- Java
- Stars
- 2.6k
- Forks
- 2.2k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 178
Description
Repro steps:
- client is on gateway mode
- create container A, verify the collectionRid
- do some read/write/query operations using the container
- delete the container
- re-create the container with same name
- verify the collectionRid is different than the previous one
- do read/write/query operation, fail with com.azure.cosmos.CosmosException: {"innerErrorMessage":"{\"Errors\":[\"Collection rid provided by the user does not match the existing collection.\"]}, StatusCode: BadRequest"}
Root cause:
TBD, but could be related to the following context not being reset during retry:
request.forceNameCacheRefresh = true;
request.requestContext.resolvedCollectionRid = null;
Tests converge after fix:
- need to make sure container recreate scenario works for direct mode
- need to make sure container recreate scenarios works for gateway mode
- need to make sure container recreate scenarios works for all operation types
Contributor guide
Assessment
This issue has not been assessed yet.