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

   ## Summary
   
   `SegmentStatusChecker`'s logic to skip recently created/pushed segments 
predates the pauseless
   `COMMITTING` status and only special-cased `IN_PROGRESS`. As a result, a 
`COMMITTING` segment — one
   that has finished consuming but is still being built and uploaded by the 
server on a pauseless
   table — was mishandled in two places in `updateSegmentMetrics`:
   
   1. **Wait-for-push grace period.** The reference timestamp was
      `getStatus() == IN_PROGRESS ? getCreationTime() : getPushTime()`. A 
realtime `COMMITTING` segment
      has no push time, so `getPushTime()` returns `Long.MIN_VALUE` and the 
segment is never skipped.
      While servers are still loading it, it gets counted as 
under-replicated/offline
      (`SEGMENTS_WITH_LESS_REPLICAS`, `PERCENT_SEGMENTS_AVAILABLE < 100`) and 
produces WARN log spam.
   2. **Time-range validation.** Guarded by `getStatus() != IN_PROGRESS`. A 
`COMMITTING` segment's
      start/end time is only finalized once it becomes `DONE`, so it was 
flagged as
      `SEGMENTS_WITH_INVALID_START_TIME` / `SEGMENTS_WITH_INVALID_END_TIME`.
   
   ## Fix
   
   Both checks now key off `Status.isCompleted()` (true only for 
`DONE`/`UPLOADED`), so `IN_PROGRESS`
   and `COMMITTING` segments are handled the same way. A recently committed 
segment gets the
   wait-for-push grace period and is not time-validated, while a genuinely 
stuck old `COMMITTING`
   segment is still surfaced as under-replicated (but no longer as invalid-time 
noise).
   
   ## Testing
   
   Added `SegmentStatusCheckerTest#realtimeCommittingSegmentTest`: a recently 
created `COMMITTING`
   segment is skipped entirely, while an older one is still checked for replica 
availability but never
   flagged for an invalid time range. The test fails without the fix (`expected 
[1] but found [2]`)
   and passes with it. The full `SegmentStatusCheckerTest` suite (30 tests) 
passes.
   
   🤖 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