fhan688 opened a new pull request, #3498:
URL: https://github.com/apache/fluss/pull/3498

   ### Purpose
   
     Linked issue: https://github.com/apache/fluss/issues/3348
   
     Large rebalance plans may activate too many bucket movement tasks at once, 
which can increase pressure on the CoordinatorServer and TabletServers in large 
clusters.
   
     This PR adds a coordinator configuration to limit how many bucket 
rebalance tasks are activated in one round. When the limit is enabled and a 
generated rebalance plan exceeds the limit, Fluss splits the plan into 
recoverable rounds, persists full progress in ZooKeeper, and activates the next 
round only after all bucket tasks in the current round reach a final state.
   
     The default behavior remains unchanged.
   
   ### Brief change log
   
     - Add coordinator.rebalance.max-buckets-per-round with default value 0.
         - 0 disables round limiting and keeps the existing behavior.
         - A positive value enables round-based rebalance execution when the 
generated plan is larger than the configured limit.
   
     - Move rebalance generation and registration into RebalanceManager.
         - Keep the legacy single-task path when round limiting is disabled or 
unnecessary.
         - Split large plans deterministically by table id, partition id, and 
bucket id.
         - Persist round execution metadata and per-round bucket progress in 
ZooKeeper.
         - Continue writing the currently active round to the legacy rebalance 
task znode for compatibility with existing execution flow.
   
     - Add round-based rebalance recovery and lifecycle handling.
         - Restore the first unfinished round after CoordinatorServer restart.
         - Aggregate progress from all persisted rounds for 
listRebalanceProgress.
         - Mark unfinished round tasks as CANCELED when canceling a round-based 
rebalance.
         - Advance to the next round after the current round reaches final 
bucket states.
   
     - Add ZooKeeper metadata models and JSON serde for:
         - RebalanceExecution
         - RebalanceRound
   
     - Add tests for:
         - default legacy behavior
         - small plans that do not need splitting
         - multi-round completion
         - partitioned table buckets
         - recovery from ZooKeeper
         - canceling round-based rebalance
         - JSON serde compatibility for new metadata
   
   ### Tests
   
     - git diff --check
     - mvn -pl fluss-server -am -DskipITs -Dcheckstyle.skip=true 
-DfailIfNoTests=false 
-Dtest=RebalanceManagerTest,RebalanceExecutionJsonSerdeTest,RebalanceRoundJsonSerdeTest
 test
   
   ### API and Format
   
     - Adds a new coordinator configuration:
         - coordinator.rebalance.max-buckets-per-round
   
     - No public client API or RPC protocol changes.
     - Adds new ZooKeeper metadata under the existing rebalance znode:
         - /cluster/rebalance/execution
         - /cluster/rebalance/rounds/[roundIndex]
   
     - Backward compatibility:
         - The default value 0 preserves existing behavior.
         - Existing single rebalance task metadata remains the active execution 
format when round limiting is disabled or the plan size does not exceed the 
configured limit.
         - In round-based mode, the active round is still registered as the 
legacy rebalance task.
   
   ### Documentation
   
     - Add the new configuration to website/docs/maintenance/configuration.md.
     - Add operational guidance for limiting active rebalance bucket tasks to 
website/docs/maintenance/operations/rebalance.md.


-- 
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]

Reply via email to