lucliu1108 opened a new pull request, #24245: URL: https://github.com/apache/kafka/pull/24245
`RemotePartitionMetadataStore#getRemoteLogMetadataCache` used to throw `ReplicaNotAvailableException` when the remote log metadata cache for a partition was not yet initialized. Its callers in `TopicBasedRemoteLogMetadataManager` implement `RemoteLogMetadataManager`, whose methods declare `throws RemoteStorageException`, but `ReplicaNotAvailableException` is not a subclass of it, so callers could not handle this retriable error by catching `RemoteStorageException`. This change throws `RemoteStorageNotReadyException` instead, which is a `RetriableRemoteStorageException` and whose javadoc already covers a metadata layer that is still initializing. To keep the error code returned to clients unchanged, `RemoteLogReader` and `RemoteLogOffsetReader` convert `RemoteStorageNotReadyException` back to `ReplicaNotAvailableException`, so remote Fetch and ListOffsets requests still return `REPLICA_NOT_AVAILABLE` and clients keep retrying as before. -- 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]
