apache / helix

Mirror of Apache Helix
Apache License 2.0
457 stars 218 forks source link

Deprecate HELIX_DISABLED_REASON and refactor how InstanceOperation is represented in instance configs. #2801

Closed zpinto closed 1 month ago

zpinto commented 2 months ago

Issues

Description

Deprecate HELIX_DISABLED_REASON and HELIX_DISABLED_TYPE and refactor INSTANCE_OPERATION to be HELIX_INSTANCE_OPERATIONS listField.

In order to prevent conflicts from different clients setting the InstanceOperation. We will now introduce the HELIX_INSTANCE_OPERATIONS.

The list will be ordered by the earliest to the most recent operations. As before, any client using the old helix enabled APIs will always take precedence over the INSTANCE_DISABLED_OVERRIDABLE_OPERATIONS when those fields are set.

When users of the new InstanceOperation APIs set the operation type to be DISABLE, we will also set the old HELIX_ENABLED field for backwards compatibility.

For all invocations of InstanceOperation APIs, the source will be USER unless otherwise specified. In most cases, this is the trigger used. If an AUTOMATION source is used a separate entry will made in the list. Whichever non ENABLE InstanceOperation entry was created last is the active InstanceOperation that is used in the controller and the returned from getInstanceOperation API.

Tests

Changes that Break Backward Compatibility (Optional)

Commits

Code Quality

zpinto commented 1 month ago

This PR is ready to be merged!

Final Commit Message

Deprecate HELIX_DISABLED_REASON and HELIX_DISABLED_TYPE; Refactor INSTANCE_OPERATION to HELIX_INSTANCE_OPERATIONS List Field

To prevent conflicts from different clients setting the InstanceOperation, we are introducing the HELIX_INSTANCE_OPERATIONS list.

Key changes:
- Clients using the old Helix enabled APIs will take precedence over INSTANCE_DISABLED_OVERRIDABLE_OPERATIONS when those fields are set.
- When the new InstanceOperation APIs set the operation type to DISABLE, the old HELIX_ENABLED field will also be set for backwards compatibility.
- For all InstanceOperation API invocations, the source will default to USER unless specified otherwise. An AUTOMATION source will create a separate entry in the list.
- The most recent non-ENABLE InstanceOperation entry will be the active InstanceOperation used by the controller and returned by the getInstanceOperation API.

These changes ensure smoother operation transitions and maintain compatibility with existing APIs.