imbajin commented on code in PR #3356:
URL: https://github.com/apache/hugegraph/pull/3356#discussion_r4351246128
##########
hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/TaskScheduleService.java:
##########
@@ -143,6 +186,29 @@ public void init() {
}
}, 2, 30,
TimeUnit.SECONDS);
+ if (pdConfig.isBalanceLeaderEnable()) {
+ long interval = pdConfig.getBalanceLeaderInterval();
+ int maxSkew = pdConfig.getBalanceLeaderMaxSkew();
+ if (interval > 0 && maxSkew >= 0) {
+ balanceLeaderTask = executor.scheduleWithFixedDelay(() -> {
+ try {
+ autoBalancePartitionLeader();
Review Comment:
⚠️ Important: This timer accepts any positive `pd.balance-leader-interval`,
but the call reaches `balancePartitionLeader(false, ...)`, which still applies
a fixed 30-second `BalanceLeaderInterval`. For example, with the documented
valid value of 10 seconds, the callback checks every 10 seconds but eligible
leader transfers are still throttled to at most once per 30 seconds. Please
make the periodic planner honor this configured interval, or reject and
document values below 30 seconds.
--
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]