-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Scoping session token per partition level for gateway call and enabling session token for multi master create request #25555
Scoping session token per partition level for gateway call and enabling session token for multi master create request #25555
Conversation
…ng session token for multi master create request
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/SessionTokenHelper.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java
Show resolved
Hide resolved
One more option which might simplify the flow is to include the sessiontoken for a single partition always reads/writes (assuming SM write with session token is not an issue). This simplifies the conceptual model, implementation and validation as well. |
In write we need session token only in one scenario (consistency have to be session and its multi master), so adding extra header on other cases is redundant. Now this is inline with our existing direct mode. Also it will be overhead to test the scenarios where we are not sending session token till now |
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxDocumentClientImpl.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java
Outdated
Show resolved
Hide resolved
Testing aspect is interesting. Practically SessionNotAvailable should never happen as the writes are to the Primary always. With SM its always guaranteed. Now the only scenario that might come into the mix is container re-create and stale session token, that a different independent problem which is applicable to writes as well. |
Pinged backend team for feedback and will revert back with details. |
This pull request is protected by Check Enforcer. What is Check Enforcer?Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass. Why am I getting this message?You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged. What should I do now?If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows: What if I am onboarding a new service?Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment: |
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
a few minor comments on NPE. other than that LGTM.
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java
Outdated
Show resolved
Hide resolved
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
LGTM - Thanks
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java
Show resolved
Hide resolved
...smos/azure-cosmos/src/test/java/com/azure/cosmos/implementation/RxGatewayStoreModelTest.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/implementation/SessionTest.java
Outdated
Show resolved
Hide resolved
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.
LGTM. Thanks
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
[Hub Generated] Review request for Microsoft.AzureStackHCI to add version preview/2023-09-01-preview (Azure#25555) * Adds base for updating Microsoft.AzureStackHCI from version preview/2023-07-01-preview to version 2023-09-01 * Updates readme * Updates API version in new specs and examples * update 2023-09-01 from https://github.com/Azure/azure-rest-api-specs-pr/pull/14245 * add suppressions from cluster resources * remove suppressions from cluster team as some of the files don't exist yet * remove name redundancy in definitions, remove x-ms-client-flatten in gateway * remove suppression GetCollectionOnlyHasValueAndNextLink * remove x-ms-code-generation-settings from resource files since the client name is already set in the title lin in readme file according to docs: https://github.com/Azure/azure-openapi-validator/blob/main/docs/deprecated-xms-code-generation-setting.md * pick up changes from https://github.com/Azure/azure-rest-api-specs-pr/pull/14872 * pick up changes from https://github.com/Azure/azure-rest-api-specs-pr/pull/15062 * fix routetable properties to readonly and correct name according to https://github.com/Azure/azure-rest-api-specs-pr/blob/9b0cab3710aa58519c6aa9e11f350b22e0fc3dc9/specification/network/resource-manager/Microsoft.Network/stable/2023-02-01/routeTable.json#L707 * fix property description * updating 2023-09-01 to 2023-09-01-preview according to breaking change committee guidance * remove 200 response from LRO delete * add suppression as requested reviewer --------- Co-authored-by: Patricia Huang <pathuang@pathuang-dev>
This PR contains below fixes
Approach used -
Added test cases for CRUD/Single Partition Query/ Cross Partition Query/FeedRange query/ ReadAll/ReadMany/Batch