dragonls opened a new issue, #18580:
URL: https://github.com/apache/pulsar/issues/18580

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) 
and found nothing similar.
   
   
   ### Version
   
   2.9.3
   
   ### Minimal reproduce step
   
   Not sure whether can be reproduced.
   
   ### What did you expect to see?
   
   The log of available data bytes should be positive value.
   
   ### What did you see instead?
   
   ```
   2022-11-23T20:14:03,854+0800 [offloader-OrderedScheduler-8-0] WARN  
org.apache.bookkeeper.mledger.offload.jcloud.impl.BlobStoreBackedReadHandleImpl 
- There hasn't enough data to read, current available data has -489839977 
bytes, seek to the first entry 123 to avoid EOF exception
   2022-11-23T20:14:03,873+0800 [offloader-OrderedScheduler-8-0] WARN  
org.apache.bookkeeper.mledger.offload.jcloud.impl.BlobStoreBackedReadHandleImpl 
- There hasn't enough data to read, current available data has -493956454 
bytes, seek to the first entry 127 to avoid EOF exception
   2022-11-23T20:14:04,517+0800 [offloader-OrderedScheduler-8-0] WARN  
org.apache.bookkeeper.mledger.offload.jcloud.impl.BlobStoreBackedReadHandleImpl 
- There hasn't enough data to read, current available data has -497662131 
bytes, seek to the first entry 131 to avoid EOF exception
   2022-11-23T20:14:05,402+0800 [offloader-OrderedScheduler-8-0] WARN  
org.apache.bookkeeper.mledger.offload.jcloud.impl.BlobStoreBackedReadHandleImpl 
- There hasn't enough data to read, current available data has -501507285 
bytes, seek to the first entry 132 to avoid EOF exception
   ```
   
   ### Anything else?
   
   I am using tencent COS as the tied storage, via S3 offload driver.
   
   The ledger size are bigger than 2GB, which means >= `Integer#MAX_VALUE`.
   
![image](https://user-images.githubusercontent.com/2565118/203550014-a62e69ad-338f-45f1-bf82-ccc6990205c2.png)
   
   However, the return type of `java.io.FilterInputStream#available` is `int`. 
So I am not sure whether there is numerical overflow issue here.
   
https://github.com/apache/pulsar/blob/e3611cb8517f0054fa7a6165b5345f8b8c320694/tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/impl/BlobStoreBackedReadHandleImpl.java#L129-L133
   
   
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!


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

Reply via email to