Skip to content

Remove deprecated field segmentAssignmentStrategy in SegmentsValidationAndRetentionConfig#18398

Merged
yashmayya merged 2 commits intoapache:masterfrom
J-HowHuang:remove-deprecated-table-config
May 4, 2026
Merged

Remove deprecated field segmentAssignmentStrategy in SegmentsValidationAndRetentionConfig#18398
yashmayya merged 2 commits intoapache:masterfrom
J-HowHuang:remove-deprecated-table-config

Conversation

@J-HowHuang
Copy link
Copy Markdown
Collaborator

Description

This field has been marked deprecated since #11869, and has not been used in pinot code effectively.

Backward Incompatibility

For any downstream usage of this deprecated field segmentAssignmentStrategy in segmentConfig, please read from segmentAssignmentConfigMap from first level field from table config instead. Related issue: #13659

@J-HowHuang J-HowHuang added configuration Config changes (addition/deletion/change in behavior) backward-incompat Introduces a backward-incompatible API or behavior change labels May 1, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 1, 2026

Codecov Report

❌ Patch coverage is 78.26087% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.53%. Comparing base (18b4948) to head (15cf8eb).

Files with missing lines Patch % Lines
...he/pinot/segment/local/utils/TableConfigUtils.java 75.00% 1 Missing and 3 partials ⚠️
...mmon/assignment/InstanceAssignmentConfigUtils.java 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #18398   +/-   ##
=========================================
  Coverage     63.53%   63.53%           
  Complexity     1709     1709           
=========================================
  Files          3250     3250           
  Lines        198949   198959   +10     
  Branches      30826    30830    +4     
=========================================
+ Hits         126400   126412   +12     
+ Misses        62471    62470    -1     
+ Partials      10078    10077    -1     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-21 63.53% <78.26%> (+<0.01%) ⬆️
temurin 63.53% <78.26%> (+<0.01%) ⬆️
unittests 63.53% <78.26%> (+<0.01%) ⬆️
unittests1 55.59% <21.73%> (+<0.01%) ⬆️
unittests2 34.97% <78.26%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@J-HowHuang J-HowHuang force-pushed the remove-deprecated-table-config branch from 41142d2 to 15cf8eb Compare May 4, 2026 16:46
"retentionTimeUnit": "DAYS",
"retentionTimeValue": "5",
"segmentPushType": "APPEND",
"segmentAssignmentStrategy": "BalanceNumSegmentAssignmentStrategy",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a similar PR: #18411, would love to let you do this and I can rebase:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field is not consumed by anyone currently, so it should have effectively the same behavior after removing it. The SegmentAssignmentStrategyFactory#getSegmentAssignmentStrategy has been the one who figures out the strategy to use.

The new config:

"segmentAssignmentConfigMap": {
    "OFFLINE": {
      "segmentAssignmentStrategy": "BalanceNumSegmentAssignmentStrategy"
    }
  }

serves more like an override, IMO we don't need to provide them in the example table config.

@yashmayya yashmayya added the release-notes Referenced by PRs that need attention when compiling the next release notes label May 4, 2026
@yashmayya yashmayya merged commit e36da86 into apache:master May 4, 2026
20 of 23 checks passed
@xiangfu0
Copy link
Copy Markdown
Contributor

xiangfu0 commented May 5, 2026

Opened docs follow-up: pinot-contrib/pinot-docs#798

This updates the dimension-table docs to use top-level segmentAssignmentConfigMap.OFFLINE.segmentAssignmentStrategy instead of the removed validationConfig.segmentAssignmentStrategy field.

xiangfu0 added a commit to pinot-contrib/pinot-docs that referenced this pull request May 5, 2026
## Summary
- replace stale `validationConfig.segmentAssignmentStrategy` references
with the supported top-level
`segmentAssignmentConfigMap.OFFLINE.segmentAssignmentStrategy` path for
dimension tables
- update the dimension-table example JSON to show the supported
`segmentAssignmentConfigMap` shape
- fix the in-page balanced segment assignment image path while
validating the edited page

## Cross-checks
- verified the `apache/pinot#18398` change removed
`segmentAssignmentStrategy` from `SegmentsValidationAndRetentionConfig`
- verified `TableConfig` still exposes top-level
`segmentAssignmentConfigMap`
- verified dimension-table validation now checks only
`segmentAssignmentConfigMap["OFFLINE"].segmentAssignmentStrategy` and
only allows `allservers`

## Validation
- `git diff --check`
- lightweight relative link and asset sanity check for the edited docs
files
Comment on lines +69 to +76
Map<String, SegmentAssignmentConfig> segmentAssignmentConfigMap = tableConfig.getSegmentAssignmentConfigMap();
boolean isSetReplicaGroupAssignmentStrategy = false;
if (segmentAssignmentConfigMap != null
&& segmentAssignmentConfigMap.get(instancePartitionsType.toString()) != null) {
isSetReplicaGroupAssignmentStrategy =
AssignmentStrategy.REPLICA_GROUP_SEGMENT_ASSIGNMENT_STRATEGY.equalsIgnoreCase(
segmentAssignmentConfigMap.get(instancePartitionsType.toString()).getAssignmentStrategy());
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this logic?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to see if the table has explicitly configured REPLICA_GROUP_SEGMENT_ASSIGNMENT_STRATEGY in segment assignment strategy.
I don't know whether it's common to have this strategy explicitly set in segment assignment strategy, but this is the same logic as before, just to check from the segment assignment strategy map instead of segment assignment strategy in segment validation config (the deprecated field).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 78 already covers this. When deprecating a field, in most cases we don't need to add new logic

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We always allow instance assignment when instanceAssignmentConfig is configured. It is not tight to replica group assignment strategy

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was this part of the original code

|| AssignmentStrategy.REPLICA_GROUP_SEGMENT_ASSIGNMENT_STRATEGY
            .equalsIgnoreCase(tableConfig.getValidationConfig().getSegmentAssignmentStrategy()));

And we're deprecating this so I changed this to its counterpart, which is the segmentAssignmentConfigMap.

Also correctness-wise, in SegmentAssignmentStrategyFactory#getSegmentAssignmentStrategy, if a table doesn't have instanceAssignmentConfig but has the strategy explicitly set in segmentAssignmentConfigMap, it would use replica group strategy, so this check is relevant in this sense.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized this is segment assignment config, not instance assignment config.. But this is wrong coupling. Segment assignment config shouldn't interfere with instance assignment. The old AssignmentStrategy.REPLICA_GROUP_SEGMENT_ASSIGNMENT_STRATEGY has implicit meaning on both instance assignment and segment assignment, but segment assignment shouldn't be coupled with instance assignment.

Segment assignment config is very rarely used (I even forgot its existence). We should also modify all tests to explicitly put instance assignment config instead of segment assignment config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backward-incompat Introduces a backward-incompatible API or behavior change configuration Config changes (addition/deletion/change in behavior) release-notes Referenced by PRs that need attention when compiling the next release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants