suvodeep-pyne opened a new pull request, #20026:
URL: https://github.com/apache/pinot/pull/20026

   ## Problem
   `GcsPinotFS.copyToLocalFile` checks for a missing source object with 
`Preconditions.checkState`. When the object is missing, callers get an 
`IllegalStateException` with the message `File '...' does not exists`. Callers 
can't tell that apart from a code bug. Callers that classify ingestion 
failures, such as a missing customer object versus our own bug, need the 
standard missing-file signal.
   
   ## Change
   `copyToLocalFile` now throws `FileNotFoundException("File '<srcUri>' does 
not exist")` when the blob is missing. `open()` and `copyFile()` in the same 
class already behave this way. Nothing else changes, and retries are 
unaffected: `BaseSegmentFetcher` catches `Exception` either way.
   
   ```mermaid
   flowchart LR
     A[copyToLocalFile] --> B{blob exists?}
     B -- yes --> C[downloadTo]
     B -- no --> D["FileNotFoundException(srcUri)"]
   ```
   
   ## Testing
   - Adds 
`GcsPinotFSNullSafetyTest#testCopyToLocalFileThrowsFileNotFoundExceptionWhenBlobDoesNotExist`,
 which checks the exception type and message.
   - The test fails without the fix (`IllegalStateException`) and passes with 
it.
   - Ran `GcsPinotFSNullSafetyTest`: 5/5 pass, with spotless, checkstyle and 
license checks clean.
   


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