Jackie-Jiang opened a new pull request, #19269:
URL: https://github.com/apache/pinot/pull/19269

   ## Summary
   
   #17696 introduced the validDocIds consensus modes and, in the non-`UNSAFE` 
modes, wraps every fetch failure from `getValidDocIdsBitmapFromServer` in 
`IllegalStateException`. This erased a meaningful type: the server's 404 
(`javax.ws.rs.NotFoundException`) means "no validDocIds available for this 
segment" — a missing/not-yet-persisted snapshot or a segment that is not hosted 
— which is a distinct, actionable condition that callers handle with documented 
fallbacks (e.g. treat the segment as all-valid until the snapshot is written), 
unlike the consensus-fatal failures (CRC mismatch, server not READY, replica 
disagreement). After the wrapping, a `catch (NotFoundException)` around this 
method silently became dead code, and the fallback path was replaced by a 
permanently failing task retry loop until the snapshot appears.
   
   This PR:
   - Rethrows a `NotFoundException` carrying the same contextual message 
(segment + endpoint) and the original exception as cause, so callers keep both 
the type and the diagnostics. All other fetch failures still become 
`IllegalStateException`, and the `UNSAFE` warn-and-skip behavior is unchanged — 
the failures #17696 deliberately made fatal stay fatal.
   - Documents the full contract on `getValidDocIdFromServerMatchingCrc`: 
per-mode return semantics, when null is returned, and the meaning of each 
exception type.
   - Adds the missing `@Nullable` on the second overload (it could always 
return null but was never annotated).
   - Adds unit tests on the existing mocked-reader harness: 404 → 
`NotFoundException` with context and cause (fails without this change), non-404 
→ `IllegalStateException` with cause, and `UNSAFE` skipping a failing server 
and returning the healthy replica's bitmap.
   


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