Skip to content

[CICP-51496] Retire ResourceConfig rebalance strategy - #324

Merged
LZD-PratyushBhatt merged 2 commits into
linkedin:devfrom
sjainit:sarjain/remove-resourceconfig-rebalance-strategy
Sep 29, 2026
Merged

LZD-PratyushBhatt merged 2 commits into
linkedin:devfrom
sjainit:sarjain/remove-resourceconfig-rebalance-strategy

Conversation

@sjainit

@sjainit sjainit commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Issues

  • Addresses the ResourceConfig configuration-surface cleanup under CICP-51496.

Dedicated ticket creation is blocked by Jira's expired Datavault identity token, including after an authentication retry. This PR links to the existing epic; it does not close the epic.

Description

Retire only the unused ResourceConfig copy of REBALANCE_STRATEGY, exposed through org.apache.helix.api.config.RebalanceConfig.

  • Remove its enum constant, backing field, getter/setter, record parsing and typed serialization.
  • Keep IdealState strategy selection unchanged. The multi-ZK fixture already uses IdealState's enum through merged [CICP-52135] Retire three ResourceConfig rebalance settings #322; it is no longer part of this PR's diff.
  • Preserve existing raw ResourceConfig fields as opaque metadata. The typed wrapper and constructors/builders consuming its serialized map no longer emit the retired setting; generic raw-record APIs remain unchanged.
  • Leave STATE_MODEL_FACTORY_NAME, task handling and other retained settings untouched.
    Resource-level timer support was removed upstream in Remove resource-level REBALANCE_TIMER_PERIOD #300 and remains absent;
    cluster-level periodic rebalance remains supported.
  • Preserve merged [CICP-52135] Retire three ResourceConfig rebalance settings #322's delay/mode/rebalancer-class retirement. Retain the RebalanceConfig wrapper and legacy enum types for compatibility, but no supported settings remain in the wrapper. getConfigsMap() returns a fresh mutable empty map; null constructor records remain rejected.

Includes dev at 37fe529ddb57fb4a860a3728202ef07be92f9dfe, including merged #322 and #317. Conflicts are resolved with a normal merge commit, without rewriting the PR's existing history. The final diff contains four files and retires only ResourceConfig strategy support; it is not stacked on the still-open #323 or #325.

Code audit: current Helix strategy selection reads IdealState, including AutoRebalancer and DelayedAutoRebalancer. No current runtime strategy consumer was found for ResourceConfig's composed RebalanceConfig. The paired strategy/factory downstream audit inspected 13 pinned source files across nine repositories; no affected MP strategy API caller was identified among those candidates. Inspected Espresso/Pinot and Python clients use IdealState or application-owned configuration types. This is bounded source evidence, not proof about every deployed binary, reflection path or unindexed caller; downstream builds were not run.

Saved September 23 census: across 86,624 successful ResourceConfig reads (52,248 prod, 12,080 corp, 22,296 EI), strategy was absent in prod/EI and present in two corp endpoint observations:

Namespace / cluster / resource Endpoints ResourceConfig strategy Paired IdealState
ambry / view-aggregator-cluster / Ambry-corp-VIEW corp-ltx1, corp-lva1 CrushEdRebalanceStrategy WagedRebalancer, no strategy field

These are not equal duplicates: current Helix does not consume the ResourceConfig value. Do not copy it into IdealState automatically. The original writer was not identified; the endpoints may alias one underlying record. This is saved census evidence, not a fresh live scan, and discovery/read/churn gaps limit fleet-wide absence claims. No live records are changed by this PR.

Tests

  • Local code review completed
  • Added TestRebalanceConfig.testLegacyStrategyIsNotSerialized with absent, empty, known-class and invalid-class values.
  • Added TestRebalanceConfig.testEmptyWrapperReturnsIndependentConfigMaps and testNullRecordIsRejected.
  • Adapted merged retirement coverage for an empty wrapper, preserving legacy timer/delay/mode handling, mode-name enum compatibility and strategy round trips.
  • Added TestResourceConfig.testLegacyStrategyPreservedInRecordButNotRebuilt, testConstructorDoesNotWriteLegacyStrategy and testMergeDoesNotMigrateOrOverrideStrategy.
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk11.0.21-2-msft.jdk/Contents/Home \
mvn -B -pl helix-core -am test \
  -Dtest=TestRebalanceConfig,TestResourceConfig,TestIdealState,TestDelayedRebalanceUtil \
  -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false

Result: 61 tests passed, zero failures/errors/skips; BUILD SUCCESS. Coverage includes typed serialization, original-record preservation, constructors/builders, conflicting IdealState/ResourceConfig values, retained factory support, empty-map behavior and null-record rejection. The expected invalid-IdealState log comes from the existing negative test.

The reactor compiled 616 core production sources for the existing JDK 8/JDK 11 targets and 572 test sources, including the multi-ZK fixture already updated upstream. That integration fixture was compiled, not executed. javap confirmed removal of the wrapper strategy methods/enum constant and retention of IdealState strategy methods, ResourceConfig factory/wrapper APIs and cluster timer support. The resource-level timer APIs remain absent. No full-suite, downstream-build or mutation-test claim.

Changes that Break Backward Compatibility (Optional)

Removed public APIs:

  • RebalanceConfig.RebalanceConfigProperty.REBALANCE_STRATEGY
  • RebalanceConfig.getRebalanceStrategy()
  • RebalanceConfig.setRebalanceStrategy(String)

Callers must update and recompile; already compiled clients referencing removed members are binary-incompatible. The RebalanceConfigProperty enum type remains available with no constants, and the deprecated RebalanceMode names remain available. Use IdealState's corresponding enum/getter/setter for supported strategy selection, but do not blindly migrate previously ignored ResourceConfig values.

RebalanceConfig.getConfigsMap() and ResourceConfig constructors/builders using that map no longer reproduce the legacy strategy field. Wrapping an existing ZNRecord or merging ResourceConfig with IdealState preserves the raw field; it neither affects strategy selection nor overwrites IdealState. No automatic data deletion or migration.

Documentation (Optional)

Added a README compatibility/migration section and clarified the RebalanceConfig class documentation.

Commits

  • Commit references CICP-51496 and explains the compatibility boundary.
  • Commit includes the Copilot co-author trailer.

Code Quality

  • Changes follow the surrounding Helix Java/TestNG formatting and naming conventions.
  • git diff --check passes; no dependency changes, mocks or production fallback logic.

Tests generated with unit-tests plugin

🤖 Generated with GitHub Copilot CLI

Remove the unused strategy enum, accessors, parsing and serialization
from the RebalanceConfig wrapper. Keep IdealState strategy selection
and all other ResourceConfig settings unchanged.

Preserve legacy raw-record fields without promoting ignored values
into IdealState. Cover wrapper serialization, builder and constructor
output, merge behavior and retained settings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sjainit
sjainit force-pushed the sarjain/remove-resourceconfig-rebalance-strategy branch from 17e3aa4 to 4e75b5b Compare September 28, 2026 17:40
Preserve the merged delay, mode, rebalancer-class and timer removals. Keep the empty compatibility wrapper and legacy mode-name enum while retiring strategy serialization. Adapt regression coverage and documentation to the combined configuration surface.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@LZD-PratyushBhatt
LZD-PratyushBhatt merged commit d3638ba into linkedin:dev Sep 29, 2026
3 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.

2 participants