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

   ## Summary
   
   Fixes two bugs in controller job status reporting:
   
   - **Negative reload estimated time**: `estimatedTimeRemainingInMinutes` goes 
negative and stays there indefinitely when `successCount` exceeds 
`totalSegmentCount`. This happens when segments are added/replaced after the 
reload job was submitted, causing `totalSegmentCount - successCount` to go 
negative. Fixed by clamping `remainingSegments` to `Math.max(0, ...)`. Also 
added a derived `status` field (`COMPLETED` / `COMPLETED_WITH_ERRORS` / 
`IN_PROGRESS`) to the reload status response so consumers no longer have to 
infer job completion from raw counts.
   
   - **Year 2088 rebalance "Finished at" timestamp**: `timeToFinishInSeconds` 
becomes a Unix timestamp (~1.7 billion) instead of an elapsed duration when 
`startTimeMs` is never initialized (default `0`). This occurs for `NO_OP` or 
early-failure rebalances that skip `START_TRIGGER`. The UI then computes 
`submissionTimeMs + (timestamp × 1000)` ≈ year 2080–2088. Fixed by guarding 
against `startTimeMs <= 0` and returning `0` seconds elapsed.
   
   ## Test plan
   
   - [ ] Verify `pinot-controller` module compiles cleanly (`mvn compile -pl 
pinot-controller -am`)
   - [ ] Existing `PinotTableReloadStatusReporterTest` passes
   - [ ] Manual: trigger a table reload, confirm 
`estimatedTimeRemainingInMinutes >= 0` in the response
   - [ ] Manual: confirm new `status` field appears in reload status JSON 
(`IN_PROGRESS` during reload, `COMPLETED` or `COMPLETED_WITH_ERRORS` after)
   - [ ] Manual: trigger a NO_OP rebalance, confirm `timeToFinishInSeconds` is 
`0` (not a Unix timestamp) and UI shows a reasonable "Finished at" time
   
   
   Made with [Cursor](https://cursor.com)


-- 
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