-
Notifications
You must be signed in to change notification settings - Fork 494
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
CreateItem will only retry for auto-extracted partition key in-case of container re-creation #1070
Conversation
…request would be sent twice. The retry logic for the partition key extraction was always being used if it was a user provided partition key value or an extracted partition key value. The retry logic should only be used for SDK extracted partition key value in scenarios where the cache is stale.
Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/NameRoutingTests.cs
Outdated
Show resolved
Hide resolved
…sts/NameRoutingTests.cs Co-Authored-By: Matias Quaranta <ealsur@users.noreply.github.com>
Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/NameRoutingTests.cs
Outdated
Show resolved
Hide resolved
Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/CustomHandler.cs
Outdated
Show resolved
Hide resolved
Container container = await database.CreateContainerAsync(id: "coll1", partitionKeyPath: "/doesnotexist"); | ||
ToDoActivity toDoActivity = ToDoActivity.CreateRandomToDoActivity(); | ||
|
||
ItemResponse<ToDoActivity> response = await container.CreateItemAsync(toDoActivity, partitionKey: new Cosmos.PartitionKey(toDoActivity.status)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test for other case where retry are expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test above this is testing the happy path. This test is for specifically testing that if a user provides a partition key value it is not retried on.
Pull Request Template
Description
Fixed bug where if a user provided the wrong partition key value the request would be sent twice. The retry logic for the partition key extraction was always being used if it was a user provided partition key value or an extracted partition key value. The retry logic should only be used for SDK extracted partition key value in scenarios where the cache is stale.
Type of change
Please delete options that are not relevant.