Repository navigation
Add fixed-order RegionGroup placement and leader selection by database - #19541
Open
d-wang-commit wants to merge 1 commit into
Open
d-wang-commit wants to merge 1 commit into
d-wang-commit wants to merge 1 commit into
Conversation
Place new user RegionGroups on a database-specific DataNode ring window. Prefer the first running replica in placement order for local writes.
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.
Description
Add
DB_FIXED_ORDERto place RegionGroups and select leaders by database. Setregion_group_allocate_policyandleader_distribution_policytoDB_FIXED_ORDER, withroute_priority_policy=LEADER. ConfigNode rejects incomplete combinations.With databases
a, b, c, DataNodes1, 2, 3and RF=2, new groups forcland on[3, 1]. A write tocarriving at DN 3 can run locally. If DN 3 or its replica becomes unavailable, DN 1 takes over when eligible. If neither is eligible, ConfigNode retains the last known leader.An ineligible placement target triggers a warning and PGP fallback for that database in the current batch. Existing groups retain their replica order when the catalog changes.
Tests
FixedOrderRegionBalancerTest,FixedOrderLeaderBalancerTestandConfigNodeStartupCheckTestcover placement, fallback, leader selection and configuration.IoTDBFixedOrderRegionGroupITcases passed on the earlier revision with IoTConsensus, IoTConsensusV2 and Ratis. The latest placement run passed all seven unit tests.Side effects and risks
Concentrating a database's groups on the same nodes reduces coordinator forwarding but increases the impact of correlated failures.
This PR has:
Key changed/added classes (or packages if there are too many classes) in this PR
RegionBalancerandFixedOrderRegionGroupAllocatorplace new groups and handle per-database fallback.FixedOrderLeaderBalancerselects leaders from persisted replica order.ConfigNodeStartupCheckvalidates the policy combination.