Skip to content

Add backward-incompatibility check for upsert deleteRecordColumn#18552

Merged
KKcorps merged 1 commit into
apache:masterfrom
mayankshriv:upsert-backward-compat-checks
May 21, 2026
Merged

Add backward-incompatibility check for upsert deleteRecordColumn#18552
KKcorps merged 1 commit into
apache:masterfrom
mayankshriv:upsert-backward-compat-checks

Conversation

@mayankshriv
Copy link
Copy Markdown
Contributor

@mayankshriv mayankshriv commented May 21, 2026

Summary

The deleteRecordColumn field in UpsertConfig was documented in the javadoc of validateUpsertConfigUpdate as being checked during table config updates, but the check was never implemented. Changing it mid-flight causes deletes to silently use the wrong column, since the value is cached at partition manager initialization.

This PR adds the missing backward-compatibility check, following the same pattern as the existing checks for mode, hashFunction, comparisonColumns, etc. — rejected by default, bypassable with force=true on the update API.

Why only deleteRecordColumn?

  • Enabling/disabling upsert is a supported workflow (e.g., enabling upsert on an existing table after schema changes) — kept as INFO-level logging per existing design.
  • Changing consistencyMode is an operational tuning decision that takes effect on server restart without data corruption — not a backward-incompatible change.

Tests added

  • Rejects changing, adding, or removing deleteRecordColumn
  • Verifies identical upsert config produces no violations
  • Verifies non-upsert tables produce no violations

Test plan

  • All new backward-compat tests pass (TableConfigUtilsTest#testValidateBackwardCompatibility*)
  • Existing testValidateBackwardCompatibilityAllowsPartialUpsertStrategyChanges still passes
  • Spotless, checkstyle, license checks pass clean

🤖 Generated with Claude Code

@mayankshriv mayankshriv force-pushed the upsert-backward-compat-checks branch from 9cacd82 to bd1c600 Compare May 21, 2026 01:57
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 21, 2026

Codecov Report

❌ Patch coverage is 21.42857% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.31%. Comparing base (462a156) to head (1ce6305).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...he/pinot/segment/local/utils/TableConfigUtils.java 21.42% 13 Missing and 9 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18552      +/-   ##
============================================
+ Coverage     64.24%   64.31%   +0.07%     
  Complexity     1126     1126              
============================================
  Files          3311     3311              
  Lines        203820   203829       +9     
  Branches      31720    31722       +2     
============================================
+ Hits         130949   131102     +153     
+ Misses        62356    62206     -150     
- Partials      10515    10521       +6     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-21 64.31% <21.42%> (+0.07%) ⬆️
temurin 64.31% <21.42%> (+0.07%) ⬆️
unittests 64.31% <21.42%> (+0.07%) ⬆️
unittests1 56.73% <0.00%> (+0.02%) ⬆️
unittests2 35.55% <21.42%> (+0.06%) ⬆️

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.

@mayankshriv mayankshriv force-pushed the upsert-backward-compat-checks branch from bd1c600 to a00b68a Compare May 21, 2026 04:04
The deleteRecordColumn field was documented in the javadoc as being
checked during table config updates, but the code was never implemented.
Changing it mid-flight causes deletes to silently use the wrong column
since the value is cached at partition manager initialization.

Not adding checks for enabling/disabling upsert or consistencyMode
changes — these are allowed operations. Toggling upsert on/off is a
supported workflow (e.g., enabling upsert on an existing table after
schema changes). Changing consistencyMode is an operational tuning
decision that takes effect on server restart without data corruption.

Tests added:
- Rejects changing, adding, or removing deleteRecordColumn
- Verifies identical upsert config produces no violations
- Verifies non-upsert tables produce no violations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mayankshriv mayankshriv changed the title Add backward-incompatibility checks for upsert config updates Add backward-incompatibility check for upsert deleteRecordColumn May 21, 2026
@mayankshriv mayankshriv force-pushed the upsert-backward-compat-checks branch from a00b68a to 1ce6305 Compare May 21, 2026 04:17
@mayankshriv
Copy link
Copy Markdown
Contributor Author

Thanks for the review @deepthi912!

Re: upsert toggle (comment) — Agreed, this is a supported workflow. Removed the upsert toggle violation in the latest push; it's back to the original INFO-level logging.

Re: consistencyMode (comment) — Makes sense — consistencyMode change is an operational tuning decision, not data-corrupting. Removed this check in the latest push. The PR now only adds the missing deleteRecordColumn check (which was already documented in the javadoc but never implemented).

@mayankshriv mayankshriv added the backward-incompat Introduces a backward-incompatible API or behavior change label May 21, 2026
@KKcorps KKcorps merged commit 391f814 into apache:master May 21, 2026
13 of 14 checks passed
@xiangfu0
Copy link
Copy Markdown
Contributor

Docs PR opened: pinot-contrib/pinot-docs#814

xiangfu0 added a commit to pinot-contrib/pinot-docs that referenced this pull request May 21, 2026
## Summary
- document that `deleteRecordColumn` is immutable for existing upsert
tables unless the update is forced
- add `deleteRecordColumn` to the protected-field lists on the upsert
guide and controller API reference

## Source cross-check
-
`pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java`
-
`pinot-segment-local/src/test/java/org/apache/pinot/segment/local/utils/TableConfigUtilsTest.java`
- `apache/pinot#18552`

## Validation
- `git diff --check`
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants