[Internal] Region Proximity: Adds logic to fetch and use server-provided region proximity data#5745
Draft
Meghana-Palaparthi wants to merge 4 commits intomainfrom
Draft
[Internal] Region Proximity: Adds logic to fetch and use server-provided region proximity data#5745Meghana-Palaparthi wants to merge 4 commits intomainfrom
Meghana-Palaparthi wants to merge 4 commits intomainfrom
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
| string? region = token?.ToString(); | ||
| if (!string.IsNullOrEmpty(region)) | ||
| { | ||
| result.Add(region!); |
Contributor
There was a problem hiding this comment.
since these are string literals, do we need validate them against the actual region names? Also, Do we still need this file then? https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/Microsoft.Azure.Cosmos/src/Regions.cs
| /// as set by <see cref="SetCurrentLocation"/>. Used to send region proximity hints | ||
| /// to the server during account discovery. | ||
| /// </summary> | ||
| internal string CurrentLocation { get; private set; } |
Comment on lines
+45
to
+55
| if (!string.IsNullOrEmpty(this.connectionPolicy.CurrentLocation)) | ||
| { | ||
| string sanitizedRegion = GatewayAccountReader.SanitizeRegionName(this.connectionPolicy.CurrentLocation); | ||
| if (!string.IsNullOrEmpty(sanitizedRegion)) | ||
| { | ||
| serviceEndpoint = GatewayAccountReader.AppendQueryParameter( | ||
| serviceEndpoint, | ||
| Constants.RegionProximity.SourceRegionQueryParam, | ||
| sanitizedRegion); | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
worth moving into its own method since its repeating in both endpoint manager and account reader
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Template
Description
This pull request introduces enhancements to Azure Cosmos DB's region proximity awareness and handling, allowing the SDK to better utilize the client's current region for improved geo-replicated account routing. The main improvements include tracking the client's current region, passing this information to the server, and updating preferred locations based on server-provided proximity data. Comprehensive unit tests have also been added to verify the new logic.
PR with spec document for migration from static table to server-provided region proximity : #5738
Type of change
Please delete options that are not relevant.
Closing issues
To automatically close an issue: closes #IssueNumber