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

[BUG] Azure Cosmos DB 4.13 - Bulk on Gateway mode #21126

Closed
3 tasks done
ealsur opened this issue May 4, 2021 · 0 comments · Fixed by #21420
Closed
3 tasks done

[BUG] Azure Cosmos DB 4.13 - Bulk on Gateway mode #21126

ealsur opened this issue May 4, 2021 · 0 comments · Fixed by #21420
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Cosmos

Comments

@ealsur
Copy link
Member

ealsur commented May 4, 2021

Describe the bug
When working with the client on Gateway mode and performing Bulk import operations, when the collection faces splits, the SDK is failing the Bulk operations with a 410 CosmosException

Exception or Stack Trace

{"ClassName":"CosmosException","userAgent":"azsdk-java-cosmos/4.15.0-beta.3 Windows10/10.0 JRE/11.0.9.1","statusCode":410,"resourceAddress":"https://maquaran-spark-westus2.documents.azure.com:443/dbs/test/colls/test/docs","error":"{\"code\":\"Gone\",\"message\":\"PartitionKeyRange with id '0' in collection '' doesn't exist.\\r\\nActivityId: bf7bd4dd-2136-4c34-82c2-8bbe4d7d2bca, \\r\\nRequestStartTime: 2021-05-04T00:19:02.5814811Z, RequestEndTime: 2021-05-04T00:19:02.5814811Z,  Number of regions attempted:1\\r\\n, Microsoft.Azure.Documents.Common/2.11.0, StatusCode: Gone\",\"additionalErrorInfo\":null}","innerErrorMessage":"PartitionKeyRange with id '0' in collection '' doesn't exist.\r\nActivityId: bf7bd4dd-2136-4c34-82c2-8bbe4d7d2bca, \r\nRequestStartTime: 2021-05-04T00:19:02.5814811Z, RequestEndTime: 2021-05-04T00:19:02.5814811Z,  Number of regions attempted:1\r\n, Microsoft.Azure.Documents.Common/2.11.0, StatusCode: Gone","causeInfo":null,"responseHeaders":"{Transfer-Encoding=chunked, Strict-Transport-Security=max-age=31536000, Server=Microsoft-HTTPAPI/2.0, x-ms-gatewayversion=version=2.11.0, Date=Tue, 04 May 2021 00:19:02 GMT, x-ms-activity-id=bf7bd4dd-2136-4c34-82c2-8bbe4d7d2bca, Content-Type=application/json, x-ms-substatus=1002}","requestHeaders":"[x-ms-cosmos-batch-atomic=false, Accept=application/json, x-ms-session-token=0:-1#2, x-ms-cosmos-is-batch-request=true, x-ms-date=Tue, 04 May 2021 00:19:02 GMT, x-ms-documentdb-partitionkeyrangeid=0, x-ms-cosmos-batch-continue-on-error=true, x-ms-consistency-level=Session, Content-Type=application/json]","cosmosDiagnostics":{"userAgent":"azsdk-java-cosmos/4.15.0-beta.3 Windows10/10.0 JRE/11.0.9.1","requestLatencyInMs":41,"requestStartTimeUTC":"2021-05-04T00:19:02.289941700Z","requestEndTimeUTC":"2021-05-04T00:19:02.331443600Z","connectionMode":"GATEWAY","responseStatisticsList":[],"supplementalResponseStatisticsList":[],"addressResolutionStatistics":{},"regionsContacted":["https://maquaran-spark-westus2.documents.azure.com:443/"],"retryContext":{"statusAndSubStatusCodes":null,"retryLatency":0,"retryCount":0},"metadataDiagnosticsContext":{"metadataDiagnosticList":null},"serializationDiagnosticsContext":{"serializationDiagnosticsList":[{"serializationType":"ITEM_SERIALIZATION","startTimeUTC":"2021-05-04T00:19:02.289941700Z","endTimeUTC":"2021-05-04T00:19:02.289941700Z","durationInMicroSec":0}]},"gatewayStatistics":{"sessionToken":null,"operationType":"Batch","statusCode":410,"subStatusCode":1002,"requestCharge":null,"requestTimeline":[{"eventName":"connectionCreated","startTimeUTC":"2021-05-04T00:19:02.290969600Z","durationInMicroSec":0},{"eventName":"connectionConfigured","startTimeUTC":"2021-05-04T00:19:02.290969600Z","durationInMicroSec":0},{"eventName":"requestSent","startTimeUTC":"2021-05-04T00:19:02.290969600Z","durationInMicroSec":1967},{"eventName":"transitTime","startTimeUTC":"2021-05-04T00:19:02.292937400Z","durationInMicroSec":36467},{"eventName":"received","startTimeUTC":"2021-05-04T00:19:02.329405100Z","durationInMicroSec":989}]},"systemInformation":{"usedMemory":"65651 KB","availableMemory":"4087693 KB","systemCpuLoad":"(2021-05-04T00:19:00.635608300Z 35.5%), (2021-05-04T00:19:00.635608300Z 35.5%), (2021-05-04T00:19:00.635608300Z 35.5%), (2021-05-04T00:19:00.635608300Z 35.5%), (2021-05-04T00:19:00.635608300Z 35.5%), (2021-05-04T00:19:01.061790900Z 35.5%)","availableProcessors":4},"clientCfgs":{"id":-1,"numberOfClients":2,"connCfg":{"rntbd":null,"gw":"(cps:1000, rto:PT5S, icto:PT1M, p:false)","other":"(ed: true, cs: false)"},"consistencyCfg":"(consistency: Session, mm: false, prgns: [])"}}}

To Reproduce
Running the CosmosBulkAsyncTest, createItem_withBulk with @Factory(dataProvider = "simpleClientBuilderGatewaySession") and triggering splits on the collection generates a Bulk response that contains null on the response and an exception which is a 410:

image

image

Code Snippet
Add the code snippet that causes the issue.

Expected behavior
Gateway mode should behave as Direct mode, it should be able to recover from splits.

The reason Direct mode works is because the partition routing maps are refreshed by the Consistency/HA stack, but that doesn't exist on Gateway mode.

Screenshots
Already added previously

Setup (please complete the following information):

  • OS: Windows
  • IDE : IntelliJ
  • Version of the Library used: 4.13 but also repros on the latest master

Additional context
This issue was fixed in the .NET SDK on Azure/azure-cosmos-dotnet-v3#2069

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
@ghost ghost added the needs-triage This is a new issue that needs to be triaged to the appropriate team. label May 4, 2021
@kushagraThapar kushagraThapar added Client This issue points to a problem in the data-plane of the library. Cosmos labels May 4, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label May 4, 2021
azure-sdk pushed a commit to azure-sdk/azure-sdk-for-java that referenced this issue Dec 8, 2022
Release app microsoft.app 2022 10 01 (Azure#21683)

* Adds base for updating Microsoft.App from version preview/2022-06-01-preview to version 2022-10-01

* Updates readme

* Updates API version in new specs and examples

* Add AppState and LatestReadyRevisionName (Azure#21034)

* Add new props

* add defaults

* Add swagger for client cert & CORS policy (Azure#21126)

* Fix password format of env domain for 2022-10-01 (Azure#21463)

* fix

* fix

* Remove AppState property as we decided to postpone it (Azure#21483)

* Remove AppState property as we decided to postpone it

* Fix swagger issues

* More swagger fixes

* s360 swagger correctness fixes (Azure#21472)

Co-authored-by: Nan Jiang <naji@microsoft.com>

* Add kind for managed environment (Azure#21589)

* add

* fix

* fix (Azure#21730)

* fix (Azure#21747)

Co-authored-by: p-bouchon <107427816+p-bouchon@users.noreply.github.com>
Co-authored-by: Ruslan Yakushev <1664475+ruslany@users.noreply.github.com>
Co-authored-by: zhenqxuMSFT <zhenqxu@microsoft.com>
Co-authored-by: najian <jiangnan8924@gmail.com>
Co-authored-by: Nan Jiang <naji@microsoft.com>
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Cosmos
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants