Aiven-Open / tiered-storage-for-apache-kafka

RemoteStorageManager for Apache Kafka® Tiered Storage
Apache License 2.0
91 stars 19 forks source link

feat: pre-fetch parts #411

Closed jeqo closed 10 months ago

jeqo commented 12 months ago

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.

jeqo commented 10 months ago

Closing in favor of #394 #429