d-wang-commit opened a new pull request, #19006:
URL: https://github.com/apache/iotdb/pull/19006
## 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_1` exception 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
- UT: none added; this PR only changes integration-test fixtures and
assertions.
- IT: updated `IoTDBRegionGroupLeaderDistributionIT` and the shared
migration assertions; added `migrationShouldPreserveOtherRegionFiles` in
`IoTDBRegionMigrateNormalForIoTV2StreamIT`.
- Passed all three methods in `IoTDBRegionGroupLeaderDistributionIT` and all
three methods in `IoTDBRegionMigrateNormalForIoTV2StreamIT` with 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`.
- Also passed `IoTDBRegionMigrateNormalITForIoTV2BatchIT#normal1C2DTest` and
`IoTDBRegionMigrateAddingPeerCrashForRatisIT#addingPeerCrashShouldFailAndRollback`:
8 selected IT methods passed in total.
- The same six leader/stream methods passed in the downstream edition. Both
builds used the existing Procedure persistence implementation; no production
fix was included.
- Spotless and the clean English reactor build passed. No production or
localized messages were changed.
### 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.
<!--
In each section, please describe design decisions made, including:
- Choice of algorithms
- Behavioral aspects. What configuration values are acceptable? How are
corner cases and error
conditions handled, such as when there are insufficient resources?
- Class organization and design (how the logic is split between classes,
inheritance, composition,
design patterns)
- Method organization and design (how the logic is split between methods,
parameters and return types)
- Naming (class, method, API, configuration, HTTP endpoint, names of
emitted metrics)
-->
<!-- It's good to describe an alternative design (or mention an alternative
name) for every design
(or naming) decision point and compare the alternatives with the designs
that you've implemented
(or the names you've chosen) to highlight the advantages of the chosen
designs and names. -->
<!-- If there was a discussion of the design of the feature implemented in
this PR elsewhere
(e. g. a "Proposal" issue, any other issue, or a thread in the development
mailing list),
link to that discussion from this PR description and explain what have
changed in your final design
compared to your original proposal or the consensus version in the end of
the discussion.
If something hasn't changed since the original discussion, you can omit a
detailed discussion of
those aspects of the design here, perhaps apart from brief mentioning for
the sake of readability
of this PR description. -->
<!-- Some of the aspects mentioned above may be omitted for simple and small
changes. -->
<hr>
This PR has:
- [x] been self-reviewed.
- [x] added comments explaining the assertion scope.
- [x] added integration tests.
- [x] been tested in a test IoTDB cluster.
<!-- Check the items by putting "x" in the brackets for the done things. Not
all of these items
apply to every PR. Remove the items which are not done or not relevant to
the PR. None of the items
from the checklist above are strictly necessary, but it would be very
helpful if you at least
self-review the PR. -->
<hr>
##### 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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]