pallavithegod opened a new pull request, #3359: URL: https://github.com/apache/hugegraph/pull/3359
## Main Changes (主要改动) Close #3231. - Root cause: task schedulers return empty results on followers, while `patrolPartitions()` always returned null even after requesting repairs. REST callers could not distinguish a real run, an empty plan, or a follower no-op. Part 1's exception handling is already present on master. - Fix details: check leadership before and after REST-triggered maintenance and return the existing error envelope with `NOT_LEADER` and the known leader's Raft address. Keep successful balance maps and existing patrol fields; add changed shard-group IDs and offline-shard requests to patrol results. Distinguish skipped partition balance from a completed empty plan, and preserve structured balance errors. Offline requests and transfer plans do not claim asynchronous repairs have finished. Update the API reference and chart operations notes. - Tests: add `TaskAPIResultTest` for follower refusal across task routes, the balance alias, patrol outcomes, and skipped balances; add `PartitionPatrolResultTest` for actual scheduler results and follower suppression. Existing `BalanceLeadersAPITest` still passes. ## Verifying these changes (验证改动) - [x] Added/updated unit tests in `TaskAPIResultTest` and `PartitionPatrolResultTest` - [x] Verified `mvn checkstyle:check` and `mvn apache-rat:check` pass locally Java 17 / Maven 3.9.11 validation: - `mvn apache-rat:check` - `mvn editorconfig:format` - `mvn clean compile -Dmaven.javadoc.skip=true -pl hugegraph-pd/hg-pd-test -am` - `mvn test-compile checkstyle:check -pl hugegraph-pd/hg-pd-test -am -Dcheckstyle.config.location=/pd-tasks/style/checkstyle.xml` - `mvn test -pl hugegraph-pd/hg-pd-test -am -Dtest=TaskAPIResultTest,BalanceLeadersAPITest,PartitionPatrolResultTest -Dsurefire.failIfNoSpecifiedTests=false` The explicit Checkstyle configuration selects the repository's rules for the PD modules. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
