Applies approach proposed by @AnatolyPopov on #394 to prepare cache asynchronously when fetching. This will avoid failing on fetch request timeout when remote-tier fetch hasn't complete yet.
It only pre-fetches 2 parts, the current and next one. Considering that parts are going to be either equal or greater than max fetch bytes requested per partition, this should be enough for following fetch requests to always hit the cache.
Another side-effect is that latency may improve as remote-tier fetches happen asynchronously at the beginning of the fetch instead of on fetch read.
Depends on #403
Fixes #404
Applies approach proposed by @AnatolyPopov on #394 to prepare cache asynchronously when fetching. This will avoid failing on fetch request timeout when remote-tier fetch hasn't complete yet.
It only pre-fetches 2 parts, the current and next one. Considering that parts are going to be either equal or greater than max fetch bytes requested per partition, this should be enough for following fetch requests to always hit the cache.
Another side-effect is that latency may improve as remote-tier fetches happen asynchronously at the beginning of the fetch instead of on fetch read.
See last commit.