-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kv: refactor CompareWithLocality to use enum
Prior to this commit, `CompareWithLocality` returned two boolean values indicating whether two localities were cross-region and cross-zone. However, this required callers to perform additional cross-comparison of these boolean values to make meaningful metrics updates. To simplify this, this commit introduces a new enum type `LocalityComparisonType`. It provides four locality comparison results: cross region, same region cross zone, same region same zone, and undefined (indicating error behavior). This refactoring allow the caller to directly use the comparison result without additional operations. In addition, this commit also updates the logic to classify activities between different regions as cross-regional, regardless of the zone tiers’ configuration. Initially, cross-region but same-zone tiers activities were flagged as misconfiguration. After some discussion, we have decided that regions should be non-overlapping. Hence, same zone tiers from different regions should still be considered as different zones. In addition, this commit also includes some refactoring of function parameters. Note that this commit does not change any existing functionality. Part of: #103983 Release note: None
- Loading branch information
Showing
16 changed files
with
462 additions
and
711 deletions.
There are no files selected for viewing
This file contains 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
Oops, something went wrong.