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 SWAP_IN InstanceOperation to respect HELIX_ENABLED false #2741

Merged
merged 2 commits into from
Jan 26, 2024

Conversation

zpinto
Copy link
Contributor

@zpinto zpinto commented Jan 24, 2024

Issues

  • Fix SWAP to respect instance disabled state to send all assigned partitions to OFFLINE state. SWAP_IN instance will still have the same assignment as SWAP_OUT instance.
  • Remove unnecessary logic to handle SWAP_IN node in preferenceList, this was from old approach.

Description

Previously, when a swap is initiated and the swap-in node has HELIX_ENABLED set to false, the replicas assigned to it are not sent to the OFFLINE state. In order to align with the behavior of HELIX_ENABLED = false, we will now send all assigned replicas to OFFLINE state. When the SWAP_IN instance is re-enabled, it will receive upward state transitions for its replicas.

Tests

  • Add test testNodeSwapDisableAndReenable

Changes that Break Backward Compatibility (Optional)

Removed some public methods; however, they were not in an open source release and would likely cause more confusion if they were left.

Documentation (Optional)

NA

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)

…itions to OFFLINE state. SWAP_IN instance will still have the same assignment as SWAP_OUT instance.
Copy link
Contributor

@MarkGaox MarkGaox left a comment

Choose a reason for hiding this comment

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

LGTM!

@zpinto
Copy link
Contributor Author

zpinto commented Jan 26, 2024

This PR is ready to be merged!

Final commit message:
In order to align with the behavior of HELIX_ENABLED = false, we will now send all assigned replicas to OFFLINE state. When the SWAP_IN instance is re-enabled, it will receive upward state transitions for its replicas.

@xyuanlu xyuanlu merged commit ab1f911 into apache:master Jan 26, 2024
2 checks passed
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