Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create condition based rebalancer #2846

Merged

Conversation

frankmu
Copy link
Contributor

@frankmu frankmu commented Jul 23, 2024

Issues

  • My PR addresses the following Helix issues and references them in the PR description:

resolves #2822

Description

  • Here are some details about my PR, including screenshots of any UI changes:

This PR initiates the condition based rebalancer which can perform restricted shard shuffling based on conditions. Will add more tests if the overall skeleton makes sense.

Tests

  • The following tests are written for this issue:
    N/A

  • The following is the result of the "mvn test" command on the appropriate module:

(If CI test fails due to known issue, please specify the issue and test PR locally. Then copy & paste the result of "mvn test" to here.)

Changes that Break Backward Compatibility (Optional)

  • My PR contains changes that break backward compatibility or previous assumptions for certain methods or API. They include:

(Consider including all behavior changes for public methods or API. Also include these changes in merge description so that other developers are aware of these changes. This allows them to make relevant code changes in feature branches accounting for the new method/API behavior.)

Documentation (Optional)

  • In case of new functionality, my PR adds documentation in the following wiki page:

(Link the GitHub wiki you added)

Commits

  • My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Code Quality

  • My diff has been formatted using helix-style.xml
    (helix-style-intellij.xml if IntelliJ IDE is used)

Copy link
Contributor

@junkaixue junkaixue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need the test add for this PR.

In addition, thinking about where to put the configuration for the rebalancer. My haunch is in IdealState simple fields.

package org.apache.helix.controller.rebalancer.condition;

public interface RebalanceCondition {
boolean shouldPerformRebalance();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a generic string -> string map for input ? Or directly pass the cache object.

Because condition is a piece of code logic but the real computation is happening at runtime with input.

Copy link
Contributor

@junkaixue junkaixue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@frankmu
Copy link
Contributor Author

frankmu commented Jul 25, 2024

This PR is ready to be merged. Approved by @junkaixue
Commit message: [Create condition based rebalancer]

@junkaixue junkaixue merged commit 9cf76fd into apache:helix-stickiness-rebalancer Jul 25, 2024
1 check passed
@frankmu frankmu deleted the tmu-stickiness-rebalancer branch July 25, 2024 21:38
@frankmu frankmu restored the tmu-stickiness-rebalancer branch July 25, 2024 21:49
asfgit pushed a commit that referenced this pull request Aug 2, 2024
Create condition based rebalancer
asfgit pushed a commit that referenced this pull request Aug 29, 2024
Create condition based rebalancer
asfgit pushed a commit that referenced this pull request Sep 9, 2024
Create condition based rebalancer
xyuanlu pushed a commit that referenced this pull request Sep 11, 2024
Create condition based rebalancer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants