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

Fix Empty IdealState Calculation with Disabled Nodes in AutoRebalance… #2877

Conversation

MarkGaox
Copy link
Contributor

@MarkGaox MarkGaox commented Aug 7, 2024

…Strategy

Issues

(#200 - Link your issue number here: You can write "Fixes #XXX". Please use the proper keyword so that the issue gets closed automatically. See https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue
Any of the following keywords can be used: close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved)

Description

  • Here are some details about my PR, including screenshots of any UI changes:
    (Write a concise description including what, why, how)

When calculating the preferred assignment, we should skip the node if the node is already disabled.

  • made above in
private Map<Replica, Node> computeExistingPreferredPlacement(
     final Map<String, Map<String, String>> currentMapping) {
  • refine the naming in AutoRebalanceStrategy to follow the naming conventions.

Tests

  • The following tests are written for this issue:

mvn clean install -Dmaven.test.skip.exec=true && mvn test -o -Dtest=TestAutoRebalanceStrategy -pl=helix-core

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

@xyuanlu xyuanlu left a comment

Choose a reason for hiding this comment

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

May I suggest separate the logic change and style change? It is easier to review and track change history.

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.

Split the PR with fix + refactor.

@junkaixue
Copy link
Contributor

let @zpinto take another look?

@junkaixue
Copy link
Contributor

@MarkGaox can you follow up with Zac?

Copy link
Contributor

@zpinto zpinto left a comment

Choose a reason for hiding this comment

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

LGTM

@MarkGaox
Copy link
Contributor Author

MarkGaox commented Sep 5, 2024

This PR is ready to merge. Approved by @junkaixue @zpinto

Commit message: Fix IdealState Calculation in AutoRebalanceStrategy for Disabled Nodes

@junkaixue junkaixue merged commit d6e5315 into apache:master Sep 5, 2024
1 check passed
@GrantPSpencer GrantPSpencer mentioned this pull request Sep 5, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants