Skip to content

Remove unused fields from CommonConstants - #20335

Open
Jackie-Jiang wants to merge 1 commit into
apache:masterfrom
Jackie-Jiang:cleanup-common-constants
Open

Jackie-Jiang wants to merge 1 commit into
apache:masterfrom
Jackie-Jiang:cleanup-common-constants

Conversation

@Jackie-Jiang

@Jackie-Jiang Jackie-Jiang commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Remove fields in CommonConstants that are deprecated or describe nothing the code reads.

Deprecated fields whose deprecation has shipped in a release:

  • The 23 Accounting.CONFIG_OF_* keys (forRemoval since 1.6.0). The same configs are still read through Accounting.COMMON_PREFIX / BROKER_PREFIX / SERVER_PREFIX with the Accounting.Keys names.
  • Helix.CONFIG_OF_ZOOKEEPR_SERVER (forRemoval since 1.5.0), replaced by CONFIG_OF_ZOOKEEPER_SERVER.
  • DEFAULT_PINOT_INSECURE_MODE, Broker.FALLBACK_REPLICA_GROUP_ID (replaced by FALLBACK_POOL_ID), and Server.CONFIG_OF_QUERY_EXECUTOR_OPCHAIN_EXECUTOR / DEFAULT_QUERY_EXECUTOR_OPCHAIN_EXECUTOR.
  • The MultiStageQueryRunner op stats cache keys and defaults, no longer read since the op stats cache was removed. Removing the constants does not affect startup: nothing reads or validates these keys.

Fields that describe nothing the code reads:

  • Broker.ROUTING_TABLE_CONFIG_PREFIX (pinot.broker.routing.table), left over from the old routing table builder.
  • Broker.MULTI_STAGE_BROKER_REQUEST_HANDLER_TYPE (multistage). The broker only tells grpc apart from the default netty handler.
  • Controller.PAGE_CACHE_WARMUP_QUERIES_DATA_DIR, which holds pinot.controller.page.cache.warmup.queries.dataDir. The controller reads controller.page.cache.warmup.queries.dataDir through ControllerConf.CONFIG_OF_PAGE_CACHE_WARMUP_QUERIES_DATA_DIR.

Some unreferenced fields stay because they complete a value set or name a config that is still read, e.g. BrokerResourceStateModel.ERROR, the Helix.*_INSTANCE_PREFIX_LENGTH set, STATS_REPORTING_MODE_LEGACY, and the Server.CONFIG_OF_* full keys of query executor and instance data manager configs.

Code that hard-codes keys CommonConstants already defines now uses the constants:

  • BaseControllerStarter and PinotLLCRealtimeSegmentManager read the metadata event notifier config through Minion.METADATA_EVENT_OBSERVER_PREFIX instead of their own private copies of metadata.event.notifier.
  • PinotMetricUtils reads the registry registration listeners through Minion.METRICS_REGISTRY_REGISTRATION_LISTENERS_KEY.
  • PredownloadSchedulerTest builds its configs with the Server and Helix key constants.

No config read at runtime changes. The binary compatibility check reports the removed public fields, which is expected for this change.

🤖 Generated with Claude Code

@Jackie-Jiang Jackie-Jiang added deprecation Marks deprecated APIs, configs, or features cleanup Code cleanup or removal of dead code labels Nov 20, 2026
@Jackie-Jiang
Jackie-Jiang force-pushed the cleanup-common-constants branch 2 times, most recently from 5547cad to 6e28f90 Compare November 20, 2026 21:40
@codecov-commenter

codecov-commenter commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.26%. Comparing base (9cb4ef8) to head (72dee4b).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #20335      +/-   ##
============================================
+ Coverage     71.23%   71.26%   +0.02%     
  Complexity     1639     1639              
============================================
  Files          3594     3594              
  Lines        242224   242224              
  Branches      39244    39244              
============================================
+ Hits         172560   172617      +57     
+ Misses        56741    56674      -67     
- Partials      12923    12933      +10     
Flag Coverage Δ
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-25 71.26% <100.00%> (+0.02%) ⬆️
lane-a 100.00% <ø> (ø)
lane-b 0.00% <ø> (ø)
temurin 71.26% <100.00%> (+0.02%) ⬆️
unittests 71.26% <100.00%> (+0.02%) ⬆️
unittests1 60.50% <100.00%> (+0.02%) ⬆️
unittests2 43.00% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Remove the deprecated fields whose deprecation has already shipped in a release,
and the fields that describe no config the code reads. Unreferenced fields that
complete a value set or name a config key that is still read stay.

Code that hard-codes keys CommonConstants already defines now uses the constants:
BaseControllerStarter, PinotLLCRealtimeSegmentManager, PinotMetricUtils and
PredownloadSchedulerTest.
@Jackie-Jiang
Jackie-Jiang force-pushed the cleanup-common-constants branch from 6e28f90 to 72dee4b Compare November 21, 2026 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Code cleanup or removal of dead code deprecation Marks deprecated APIs, configs, or features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants