-
Notifications
You must be signed in to change notification settings - Fork 495
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
Hedging: Adds support for writes on multi region accounts #4706
Hedging: Adds support for writes on multi region accounts #4706
Conversation
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.
All good!
...soft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs
Outdated
Show resolved
Hide resolved
...soft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs
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.
The feature is not named "multi-master", right? We call it multiple write regions, or active-active in docs. We should change the API to match.
…bilityStrategy.cs Co-authored-by: Fabian Meiswinkel <[email protected]>
…egionHedgingAvailabilityStrategy.cs Co-authored-by: Fabian Meiswinkel <[email protected]>
(Gone tests will fail on account reads so it cannot be tested with hedging)
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
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 comment nits.
Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
Outdated
Show resolved
Hide resolved
...soft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs
Outdated
Show resolved
Hide resolved
...soft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs
Outdated
Show resolved
Hide resolved
...t.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAvailabilityStrategyTests.cs
Outdated
Show resolved
Hide resolved
...t.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAvailabilityStrategyTests.cs
Outdated
Show resolved
Hide resolved
...t.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAvailabilityStrategyTests.cs
Outdated
Show resolved
Hide resolved
...t.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAvailabilityStrategyTests.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Kevin Pilch <[email protected]>
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
# Pull Request Template ## Description Adds support to use hedging on write requests for multimaster accounts. Note that this does come with the caveat that there will be more 409 errors thrown by the SDK. This is expected and applications that adapt this feature should be prepared to handle these exceptions. This feature will also be an opt in feature for Availability Strategies and users will need to especially specify that in the availability strategy definition. ``` ItemRequestOptions requestOptions = new ItemRequestOptions { AvailabilityStrategy = new CrossRegionHedgingAvailabilityStrategy( threshold: TimeSpan.FromMilliseconds(100), thresholdStep: TimeSpan.FromMilliseconds(50), multiMasterWritesEnabled: true) }; ``` ## Type of change Please delete options that are not relevant. - [] New feature (non-breaking change which adds functionality) ## Closing issues To automatically close an issue: closes #4457 --------- Co-authored-by: Fabian Meiswinkel <[email protected]> Co-authored-by: Kevin Pilch <[email protected]>
# Pull Request Template ## Description This PR cherry-picks the following commits: - #4706 - #4869 ## Type of change Please delete options that are not relevant. - [x] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) ## Closing issues To automatically close an issue: closes #IssueNumber --------- Co-authored-by: Nalu Tripician <[email protected]> Co-authored-by: Fabian Meiswinkel <[email protected]> Co-authored-by: Kevin Pilch <[email protected]> Co-authored-by: dibahlfi <[email protected]> Co-authored-by: Arooshi Avasthy <[email protected]> Co-authored-by: Kiran Kumar Kolli <[email protected]>
Pull Request Template
Description
Adds support to use hedging on write requests for multimaster accounts. Note that this does come with the caveat that there will be more 409 errors thrown by the SDK. This is expected and applications that adapt this feature should be prepared to handle these exceptions.
This feature will also be an opt in feature for Availability Strategies and users will need to especially specify that in the availability strategy definition.
Type of change
Please delete options that are not relevant.
Closing issues
To automatically close an issue: closes #4457