Rebuild upsert metadata from validDocIds snapshot on reload for Upsert with TTL tables#18860
Merged
Jackie-Jiang merged 1 commit intoJun 29, 2026
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #18860 +/- ##
=========================================
Coverage 64.79% 64.80%
Complexity 1322 1322
=========================================
Files 3393 3393
Lines 211265 211332 +67
Branches 33212 33234 +22
=========================================
+ Hits 136896 136959 +63
+ Misses 63320 63309 -11
- Partials 11049 11064 +15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
c46bf01 to
8154665
Compare
b1506e3 to
129b2a9
Compare
xiangfu0
reviewed
Jun 28, 2026
xiangfu0
left a comment
Contributor
There was a problem hiding this comment.
Found two high-signal reload-path issues; see inline comments.
xiangfu0
reviewed
Jun 28, 2026
xiangfu0
reviewed
Jun 28, 2026
90c5c94 to
0f45eaa
Compare
…ables Reloading a segment of an upsert table with metadata TTL (metadataTTL or deletedKeysTTL) previously rescanned every doc and re-added every primary key, which resurrected keys the TTL had already expired or deleted, producing incorrect query results. With snapshots enabled, segment reload now rebuilds the upsert metadata from the persisted validDocIds snapshot (valid docs only): - normal reload: proceeds only when the segment CRC matches and a snapshot exists; otherwise it fails with an error pointing the operator to forceDownload. - forceDownload reload: always proceeds, using the snapshot if present (the operator accepts a possible CRC mismatch), otherwise a full scan. Segment commit and refresh paths are unchanged: only the reload path places a snapshot on the incoming segment, so they keep the regular full-scan behavior. This supersedes the earlier approach of blocking forceDownload reload at the controller for upsert/dedup TTL tables; that API-level check is removed. Backward-incompatible: a normal (non-forceDownload) reload of an upsert table with metadata TTL and snapshots enabled now fails when the segment CRC has changed or no validDocIds snapshot exists; use a forceDownload reload in that case.
0f45eaa to
f976d47
Compare
Jackie-Jiang
approved these changes
Jun 29, 2026
Contributor
|
Opened the pinot-docs follow-up PR for this change: pinot-contrib/pinot-docs#893 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reloading a segment of an upsert table with metadata TTL (
metadataTTLordeletedKeysTTL) previously rescanned every doc and re-added every primary key, which resurrected keys the TTL had already expired or deleted — producing incorrect query results.With snapshots enabled, segment reload now rebuilds the upsert metadata from the persisted
validDocIdssnapshot (valid docs only).Behavior (upsert + metadata TTL, snapshots enabled)
Segment commit and refresh paths are unchanged — only the reload path places a snapshot on the incoming segment, so they keep the regular full-scan behavior.
Notes
Backward-incompatible
A normal & forceDownload)reload of an upsert table with metadata TTL and snapshots enabled now fails when the segment CRC has changed; use a forceDownload reload in case snapshots don't exist on server.