You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "deepthi912 (via GitHub)" <gi...@apache.org> on 2026/07/01 03:50:38 UTC

[PR] For upsert tables, skip local build on CRC mismatch during ONLINE transition [pinot]

deepthi912 opened a new pull request, #18895:
URL: https://github.com/apache/pinot/pull/18895

   ## Summary
   
   When a CONSUMING segment transitions to ONLINE and its offset matches the committed offset in ZK, the server builds the segment locally and swaps it in. For **upsert tables** this is unsafe: a locally-built segment can diverge from the segment committed by the winning replica (e.g. different docId ordering), so its CRC differs from the committed CRC. Swapping in a CRC-divergent local build can leave the upsert metadata (`validDocIds` / primary-key → record-location) inconsistent across replicas.
   
   ## Changes
   
   - Adds a `buildSegmentAndReplace(SegmentZKMetadata)` overload that, for upsert-enabled tables, compares the locally-built segment's CRC against the committed CRC in ZK (via `BaseTableDataManager.hasSameCRC`). On a mismatch it skips the local build so the caller downloads the committed segment instead.
   - The guard is applied on both the matched-offset and post-catch-up reconciliation paths in `goOnlineFromConsuming`.
   - If the locally-built segment metadata cannot be read, the check reports a mismatch so the transition downloads the committed segment rather than throwing.
   
   Non-upsert tables and callers that do not pass the committed metadata are unaffected.
   
   ## Rolling upgrade
   
   Behavior change is scoped to upsert tables; no wire/ZK format change. Mixed-version replicas converge to the committed segment either way.
   
   ## Testing
   
   Added coverage in `RealtimeSegmentDataManagerTest` for the CRC-match, CRC-mismatch, unreadable-metadata, and non-upsert paths.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Re: [PR] For upsert tables, skip local build on CRC mismatch during ONLINE transition [pinot]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #18895:
URL: https://github.com/apache/pinot/pull/18895#issuecomment-4850335246

   ## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/18895?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `87.50000%` with `2 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 56.97%. Comparing base ([`cd6dd61`](https://app.codecov.io/gh/apache/pinot/commit/cd6dd61ce3240efd62c2de851efc685bccd7e79e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`f285d4c`](https://app.codecov.io/gh/apache/pinot/commit/f285d4c81aa7ad5c12e9d5c98a3ead8fef5ad561?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 15 commits behind head on master.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/pinot/pull/18895?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...a/manager/realtime/RealtimeSegmentDataManager.java](https://app.codecov.io/gh/apache/pinot/pull/18895?src=pr&el=tree&filepath=pinot-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fcore%2Fdata%2Fmanager%2Frealtime%2FRealtimeSegmentDataManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9kYXRhL21hbmFnZXIvcmVhbHRpbWUvUmVhbHRpbWVTZWdtZW50RGF0YU1hbmFnZXIuamF2YQ==) | 87.50% | [0 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/pinot/pull/18895?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   > :exclamation:  There is a different number of reports uploaded between BASE (cd6dd61) and HEAD (f285d4c). Click for more details.
   > 
   > <details><summary>HEAD has 16 uploads less than BASE</summary>
   >
   >| Flag | BASE (cd6dd61) | HEAD (f285d4c) |
   >|------|------|------|
   >|java-21|5|1|
   >|unittests|2|1|
   >|temurin|5|1|
   >|unittests2|1|0|
   >|integration|3|0|
   >|integration1|1|0|
   >|custom-integration1|1|0|
   >|integration2|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #18895      +/-   ##
   ============================================
   - Coverage     64.80%   56.97%   -7.83%     
   + Complexity     1322        1    -1321     
   ============================================
     Files          3393     2604     -789     
     Lines        211332   152958   -58374     
     Branches      33234    24880    -8354     
   ============================================
   - Hits         136952    87149   -49803     
   + Misses        63329    58376    -4953     
   + Partials      11051     7433    -3618     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/pinot/pull/18895/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [custom-integration1](https://app.codecov.io/gh/apache/pinot/pull/18895/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration](https://app.codecov.io/gh/apache/pinot/pull/18895/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration1](https://app.codecov.io/gh/apache/pinot/pull/18895/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration2](https://app.codecov.io/gh/apache/pinot/pull/18895/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [java-21](https://app.codecov.io/gh/apache/pinot/pull/18895/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.97% <87.50%> (-7.83%)` | :arrow_down: |
   | [temurin](https://app.codecov.io/gh/apache/pinot/pull/18895/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.97% <87.50%> (-7.83%)` | :arrow_down: |
   | [unittests](https://app.codecov.io/gh/apache/pinot/pull/18895/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.97% <87.50%> (-7.83%)` | :arrow_down: |
   | [unittests1](https://app.codecov.io/gh/apache/pinot/pull/18895/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.97% <87.50%> (-0.03%)` | :arrow_down: |
   | [unittests2](https://app.codecov.io/gh/apache/pinot/pull/18895/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/pinot/pull/18895?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org