[rebalance] Support preferred leader election goal - #4236
Open
sakshichitnis27 wants to merge 1 commit into
Open
Conversation
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.
Purpose
Linked issue: close #4086
Add a deterministic, manually triggered preferred leader election operation that restores bucket leadership to the first replica in each persisted assignment without moving replicas.
Brief change log
PREFERRED_LEADER_ELECTIONgoal to the Java and Rust Admin APIs.assignment[0]is alive, online, in the ISR, and not offline-tagged.Tests
Passed:
./mvnw -pl fluss-common -Dtest=GoalTypeTest test./mvnw -q -pl fluss-server -am -Dtest=PreferredLeaderElectionGoalTest,GoalOptimizerTest,GoalOptimizerUtilsTest,LeaderReplicaDistributionGoalTest,ReplicaLeaderElectionTest -Dsurefire.failIfNoSpecifiedTests=false test./mvnw -q -pl fluss-client -am -Dtest=RebalanceITCase#testPreferredLeaderElectionAfterRecovery -Dsurefire.failIfNoSpecifiedTests=false test./mvnw -q -pl fluss-flink/fluss-flink-1.20 -am -Dtest=Flink120ProcedureITCase#testPreferredLeaderElectionProcedure -Dsurefire.failIfNoSpecifiedTests=false test./mvnw -q -pl fluss-common,fluss-server,fluss-client,fluss-flink/fluss-flink-common -am -DskipTests validateThe full
fluss-serversuite ran 1,323 tests on the Oracle host. Seven unrelated storage tests failed because the host filesystem was above the tests' 85% disk-usage safety threshold and contained non-fresh test storage; no rebalance or leader-election tests failed.Rust tests were not run locally because the Oracle host does not have
cargoorrustc.API and Format
Adds
GoalType.PREFERRED_LEADER_ELECTIONwith wire value3. No RPC schema or storage-format changes.Documentation
Documents Java Admin and Flink SQL usage, standalone-goal behavior, and preferred-replica eligibility requirements.