Skip to content

[CICP-51496] Retire legacy IdealState mode - #329

Open
sjainit wants to merge 1 commit into
linkedin:devfrom
sjainit:sarjain/retire-ideal-state-mode
Open

sjainit wants to merge 1 commit into
linkedin:devfrom
sjainit:sarjain/retire-ideal-state-mode

Conversation

@sjainit

@sjainit sjainit commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Issues

Campaign: https://linkedin.atlassian.net/browse/CICP-51496

Description

Warning

Do not merge or deploy until the downstream migrations are released and legacy-only records, obsolete mode aliases, and legacy mode rules have been audited/migrated. Opening this PR does not satisfy those prerequisites.

Retire the deprecated IdealState mode configuration and make REBALANCE_MODE the only supported mode field.

  • Remove IdealStateProperty.IDEAL_STATE_MODE, IdealStateModeProperty, the deprecated getter/setter, legacy normalization/denormalization, and the now-unused LEGACY_TASK_REBALANCERS constant.
  • Write only the modern field. Read it without mutating records or consulting legacy metadata.
  • Preserve the effective SEMI_AUTO default for missing/invalid modern values, as explicitly requested. Respect every valid modern enum value, including explicit NONE.
  • Parse modern enum names only. Invalid inputs, including retired AUTO/AUTO_REBALANCE aliases, are logged and return the caller's existing default.
  • Exclude legacy metadata from topology change detection, migrate in-repo fixtures/rules/examples, and remove the obsolete resource-summary row from the UI.

Raw legacy fields are preserved as opaque metadata, not deleted or synchronized. Generic raw-record APIs continue accepting unknown fields. The old admin-webapp constant named IDEAL_STATE_MODE is retained because its value is the still-supported HTTP argument "mode", not the retired stored configuration key.

Merge/release prerequisites:

  • Merge and release the relevant downstream migrations: linkedin-multiproduct/espresso#3178, linkedin-multiproduct/lipy-helix#274, linkedin-multiproduct/lipy-venice-libs#618, and linkedin-multiproduct/lipy-ambry-clustermap#840. Reader upgrades must precede modern-only writers.
  • Complete the remaining downstream-reference classification, including the Databus deprecated API reference and other writer/tooling references. These four PRs are an initial batch, not proof that every caller is migrated.
  • Refresh the legacy-only record audit and migrate affected persisted records under separately approved operational scope. A previous saved census found three legacy-only endpoint/resource observations; that historical result is not a current or exhaustive census.
  • Audit explicit NONE, invalid modern values, obsolete string aliases, and any IdealStateRule! filters referring to IDEAL_STATE_MODE; replace fallback-dependent settings with explicit intended modern values.

No live configuration edits, cluster operations, or downstream deployments are included.

Tests

  • Local code review completed
  • Added model coverage for all modern modes, a 66-case modern/legacy matrix, non-mutating reads, opaque-field preservation, parser defaults, and removed public API shape.
  • Added topology-trimmer and persisted admin-payload coverage; migrated controller/task/rule fixtures.
  • Extended REST creation/readback coverage for modern-only JSON and added four UI model regressions.

Java 11 native Maven validation:

mvn -B -ntp -pl helix-rest -am test \
  '-Dtest=TestIdealState,TestHelixPropoertyTimmer,TestBestPossibleCalcStageCompatibility,TestEvacuateInstanceTaskAssignment,TestFixedTargetedTaskAssignmentCalculator,TestTargetedTaskStateChange,TestZkHelixAdmin#testAddResourceWritesOnlyModernRebalanceMode,TestInvalidResourceRebalance,TestMessageThrottle2,TestAutoIsWithEmptyMap,TestResourceConfig,TestRebalanceConfig,TestResourceAccessor#testGetResources+testGetResource+testAddResources+testResourceConfig+testIdealState' \
  -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false

Results on dev base d3638bac5 (including #324): 145 core cases and 5 REST cases passed, with zero failures/errors/skips. Both Java 8 and Java 11 class outputs were checked for removal of the old APIs/enum.

UI validation with Node 20 and Yarn 1.22:

yarn test --runInBand --runTestsByPath src/app/resource/shared/resource.model.spec.ts \
  --coverageReporters=html --coverageReporters=lcov \
  --coverageReporters=json --coverageReporters=text
yarn type:check
yarn exec prettier -- --check src/app/resource/shared/resource.model.ts \
  src/app/resource/shared/resource.model.spec.ts \
  src/app/resource/resource-detail/resource-detail.component.html
yarn exec eslint -- src/app/resource/shared/resource.model.ts \
  src/app/resource/shared/resource.model.spec.ts \
  src/app/resource/resource-detail/resource-detail.component.html

Results: 4 UI cases passed; type-checking, touched-file formatting/lint and git diff --check passed. The standard ignored sample server config was created with yarn copy:config. Coverage remained enabled; built-in output formats avoid the existing misconfigured jest-html-reporters coverage-reporter entry. Dependency manifests and lockfiles are unchanged.

These are focused validations, not a full backend/frontend suite or a live migration rehearsal.

Changes that Break Backward Compatibility (Optional)

  • Removed Java symbols are source- and binary-incompatible. Rebuild/release downstream consumers before upgrading.
  • Modern setters no longer emit compatibility metadata; old readers that require the field must already be upgraded.
  • Legacy-only FULL_AUTO/CUSTOMIZED records no longer recover their mode from the old field. Missing/invalid modern values now use SEMI_AUTO independently of legacy metadata.
  • Explicit NONE is preserved rather than normalized through legacy/default mode. It does not select an operational rebalancer.
  • Reads no longer synthesize or repair mode fields in memory. Existing stale legacy fields remain unchanged even after a modern setter call.
  • The string parser no longer translates legacy aliases. In particular, an admin call using AUTO_REBALANCE now logs an invalid value and takes its existing default rather than selecting FULL_AUTO.
  • The UI no longer exposes the idealStateMode summary property/row.

Backout must account for newly written modern-only records: reverting binaries alone is insufficient for readers that still require legacy metadata. Coordinate compatible readers and the owning teams' approved snapshot/config restoration procedures. Do not infer legacy values from all modern modes: legacy AUTO is lossy for TASK/USER_DEFINED.

Documentation (Optional)

README compatibility guidance documents defaults, the migration mapping, ignored raw metadata, source/binary breaks, and operational prerequisites. IdealState Javadocs and active examples were updated. Historical versioned website content and generated documentation snapshots were not rewritten.

Commits

The commit references CICP-51496, uses an imperative subject, and includes the Copilot co-author trailer. No unrelated main-checkout changes are included.

Code Quality

The change reuses the existing enum-field reader and modern mode API, narrows parser exception handling, and preserves repository conventions. UI files were formatted with the repository's Prettier and passed ESLint.

🤖 Generated with GitHub Copilot CLI

Use REBALANCE_MODE alone without mutating records on read. Preserve
SEMI_AUTO for missing/invalid modern values and honor explicit NONE.
Remove legacy APIs, dual-writing, aliases and topology significance;
migrate fixtures and UI metadata and document rollout prerequisites.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant