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

Hedging: Adds support for writes on multi region accounts #4706

Merged

Conversation

NaluTripician
Copy link
Contributor

@NaluTripician NaluTripician commented Sep 18, 2024

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

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good!

@NaluTripician NaluTripician changed the title add mm hedging support Hedging: Adds support for multimaster writes Sep 18, 2024
@NaluTripician NaluTripician self-assigned this Sep 18, 2024
@NaluTripician NaluTripician added the Hedging Any issue/feature request related to request hedging label Sep 18, 2024
@NaluTripician NaluTripician marked this pull request as ready for review October 10, 2024 19:51
@NaluTripician NaluTripician requested a review from khdang as a code owner October 10, 2024 19:51
@NaluTripician NaluTripician requested a review from a team as a code owner October 15, 2024 17:23
Copy link
Member

@Pilchie Pilchie left a 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.

@NaluTripician NaluTripician changed the title Hedging: Adds support for multimaster writes Hedging: Adds support for writes on multi region accounts Nov 21, 2024
Copy link
Member

@FabianMeiswinkel FabianMeiswinkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Thanks

Copy link
Member

@Pilchie Pilchie left a 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.

Copy link
Member

@FabianMeiswinkel FabianMeiswinkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NaluTripician NaluTripician added the auto-merge Enables automation to merge PRs label Nov 26, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot merged commit 470612e into master Nov 26, 2024
24 checks passed
@microsoft-github-policy-service microsoft-github-policy-service bot deleted the users/nalutripician/hedgingMMWrites branch November 26, 2024 22:48
kundadebdatta pushed a commit that referenced this pull request Jan 8, 2025
# 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]>
microsoft-github-policy-service bot pushed a commit that referenced this pull request Jan 8, 2025
# 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge Enables automation to merge PRs Hedging Any issue/feature request related to request hedging
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Hedging With Writes on MultiMaster
5 participants