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

Support preserving history of HELIX_ENABLED legacy fields when combo of instance operation and old helix version are used #2987

Merged

Conversation

zpinto
Copy link
Contributor

@zpinto zpinto commented Jan 7, 2025

Issues

  • Support preserving history of HELIX_ENABLED legacy fields when combo of instance operation and old helix version are used

Description

When the new instance operation APIs are used, we need to consider that an older version of helix could have been used to modify the legacy fields of HELIX_ENABLED, HELIX_DISABLED_TYPE, and HELIX_DISABLED_REASON. When this happens, we need to write those legacy fields to the USER source instance operation to preserve the history when another source sets the instance operation. When the other source re-enables the instance, we should restore the old legacy fields with what was previously set.

Tests

  • Added to test TestInstanceConfig#testEnabledInstanceBackwardCompatibility

Changes that Break Backward Compatibility (Optional)

  • Yes, will add more information

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)

@zpinto zpinto force-pushed the zpinto/add_write_back_instance_operation branch from ea5ae20 to 78b5259 Compare January 10, 2025 03:19
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.

Thanks for the change.
I would suggest separate the formatting and logic change for easier review. :D

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.

The pr is too large for reviewing combining format change + logic change. Please split the PR with purely logic change + refactoring.

@junkaixue
Copy link
Contributor

Also, this is related to instance operations. Highly recommend to fix the unstable instance operation test as well. It is vulnerable there for a long while.

…at an older version of helix could have been used to modify the legacy fields of HELIX_ENABLED, HELIX_DISABLED_TYPE, and HELIX_DISABLED_REASON. When this happens, we need to write those legacy fields to the USER source instance operation to preserve the history when another source sets the instance operation. When the other source re-enables the instance, we should restore the old legacy fields with what was previously set.
@zpinto zpinto force-pushed the zpinto/add_write_back_instance_operation branch from 78b5259 to f83072b Compare January 16, 2025 02:20
@xyuanlu
Copy link
Contributor

xyuanlu commented Jan 18, 2025

Overall looks good. Only one minor comment.

@zpinto
Copy link
Contributor Author

zpinto commented Jan 18, 2025

This PR is ready to be merged.

Commit message:
When the new instance operation APIs are used, we need to consider that an older version of helix could have been used to modify the legacy fields of HELIX_ENABLED, HELIX_DISABLED_TYPE, and HELIX_DISABLED_REASON. When this happens, we will write those legacy fields to the USER source instance operation to preserve the history when another source sets the instance operation. When the other source re-enables the instance, we should restore the old legacy fields with what was previously set.

@xyuanlu xyuanlu merged commit 0f95ef3 into apache:master Jan 18, 2025
2 checks passed
zpinto added a commit to zpinto/helix that referenced this pull request Jan 22, 2025
…of instance operation and old helix version are used (apache#2987)

When the new instance operation APIs are used, we need to consider that an older version of helix could have been used to modify the legacy fields of HELIX_ENABLED, HELIX_DISABLED_TYPE, and HELIX_DISABLED_REASON. When this happens, we will write those legacy fields to the USER source instance operation to preserve the history when another source sets the instance operation. When the other source re-enables the instance, we should restore the old legacy fields with what was previously set.
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