Repository navigation
Fix leader distribution and RegionGroup directory assertions - #19006
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
Count all DataRegion leaders and require a complete, healthy distribution. Check only the migrated consensus group and preserve unrelated region files.
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
Count the full DataRegion leader population
The leader-distribution fixture creates three or six user DataRegionGroups. Internal database groups participate in the same balancing round, but the assertions removed those groups and then required the remaining user-only subset to be balanced. A balanced cluster can therefore fail with a user-only distribution such as {1=1, 3=2}.
Count the fixture's DataRegionGroups including internal databases, without mixing in independently balanced SchemaRegion leaders. Poll for exactly one Running leader per group, the expected number of leader-holding nodes, and a maximum per-node count difference of one. Keep the ReadOnly and stopped-node transitions and verify the same conditions after them.
Check only the migrated consensus group
A migration removes one RegionGroup replica, so other groups' consensus directories may remain on the source DataNode. Replace the whole-directory emptiness check and hardcoded
1_1exception with checks for the selected group ID. Resolve Ratis group directories through the existing Raft group UUID conversion. Add a regression that leaves an unrelated three-replica database on the source node and verifies that its directories survive the migration.Tests
IoTDBRegionGroupLeaderDistributionITand the shared migration assertions; addedmigrationShouldPreserveOtherRegionFilesinIoTDBRegionMigrateNormalForIoTV2StreamIT.IoTDBRegionGroupLeaderDistributionITand all three methods inIoTDBRegionMigrateNormalForIoTV2StreamITwith a clean reactor build:mvn clean verify -pl integration-test -am -PClusterIT,with-integration-tests -DskipUTs -Dit.test=IoTDBRegionGroupLeaderDistributionIT,IoTDBRegionMigrateNormalForIoTV2StreamIT -DfailIfNoTests=false -Dfailsafe.failIfNoSpecifiedTests=false.IoTDBRegionMigrateNormalITForIoTV2BatchIT#normal1C2DTestandIoTDBRegionMigrateAddingPeerCrashForRatisIT#addingPeerCrashShouldFailAndRollback: 8 selected IT methods passed in total.Side effects and risks
No production code, persistence format, leader-balancing policy, or node-state restriction changes. The leader checks retain the existing 50-second bound and now reject missing leaders and non-Running leader replicas. Migration checks still require removal of the selected source directory and existence of the destination directory; unrelated RegionGroups no longer cause a false failure. A forced-down DataNode retains the existing skip behavior for local file checks.
This PR has:
Key changed/added classes (or packages if there are too many classes) in this PR
IoTDBRegionGroupLeaderDistributionIT: include internal DataRegion leaders and reject incomplete or unhealthy distributions.IoTDBRegionOperationReliabilityITFramework: check directories for the selected RegionGroup.IoTDBRegionMigrateITFrameworkForRatis: map the selected group to its Ratis UUID directory.IoTDBRegionMigrateNormalForIoTV2StreamIT: verify unrelated region files survive migration.