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

   ## Context
   
   `revertSegmentUpsertMetadata()` asks `getPrevKeyToRecordLocationSize()` 
twice. The first call only
   compares against zero — "did the revert leave anything behind?" — and 
returns early in the normal
   case. The second call, reached only when something was left, needs the 
actual count for the warning
   and the inconsistent-rows metric.
   
   Counting is free for the on-heap implementations 
(`ConcurrentHashMap.size()`), so the shape of the
   API has never mattered. It does for an implementation whose 
previous-location map is not a map: a
   store-backed one has to scan its entire keyspace to produce a number, when 
the question being asked
   is one a single seek answers.
   
   ## Fix
   
   Add `isPrevKeyToRecordLocationEmpty()`, defaulting to the existing 
`getPrevKeyToRecordLocationSize()
   == 0`, and use it for the first check. Implementations that can answer 
emptiness more cheaply than a
   count override it; the on-heap ones keep the default and behave exactly as 
before.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to