forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add retry to tolerate the offload index file read failure (apache#12452)
* Add retry to tolerate the offload index file read failure --- *Motivation* We met the ReadLedgerMetadata exception when reading the index file. The index file only read once, so it may not read all the data from the stream and cause the metadata read failed. We need to ensure the all data is read from the stream or the stream is end. When the stream is end, we will receive the EOF exception, so we need to use `readFully` not `read`. Add the retry logic to tolerate the failure cause by the network. Because the stream is from the HTTP, so it's may break on some case. Add a small retry to avoid it to backoff by the dispatcher. *Modifications* - Use `readFully` to replace the `read` method - Add a small retry for handling the index block build * Add comments and enrich log
- Loading branch information
Showing
2 changed files
with
27 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters