[ADH-8124] Add S3 Gateway ozone objects cache#10
Conversation
f306dde to
f844ae5
Compare
iamlapa
left a comment
There was a problem hiding this comment.
Also, BucketEndpoint::handleGetRequest(S3RequestContext context, String bucketName)
ozoneKeyIterator = bucket.listKeys(prefix, prevKey, shallow);This path still ignores the S3 max-keys value when choosing how much to fetch from OM; the iterator falls back to ozone.client.list.cache, which is 1000 by default, so max-keys=1 can still over-fetch badly. We should add an S3-specific list path that passes a backend fetch size like min(maxKeys + 1, configuredCap).
f844ae5 to
e96d57d
Compare
Yeah, it was already discussed with Alexander and we decided to skip this requirement for now and check if further work is needed in a separate task. Unfortunately, we can't simply pass the value of |
Added caching OM client for S3 gateway component. Currently, it caches metadata for S3 volume, buckets, keys (both regular and extended versions) in local per-user Caffeine caches. Cache entries are evicted on corresponding write operations (delete, rename) or by TTL.
Related options:
ozone.s3g.object.cache.enabledfalseozone.s3g.object.cache.metrics.enabledtrueozone.s3g.object.cache.volume.size10ozone.s3g.object.cache.volume.ttl.ms3000ozone.s3g.object.cache.bucket.size100ozone.s3g.object.cache.bucket.ttl.ms3000ozone.s3g.object.cache.key.size1000ozone.s3g.object.cache.key.ttl.ms3000Also a
Hadoop Metrics2source is added to collect and publish the following statistics for all S3 object caches (s3VolumeCache,s3BucketCache,s3HeadKeyCache,s3KeyInfoCache):hitCounthitRatemissCountloadSuccessCountloadFailureCountloadFailureRateevictionCountaverageLoadPenaltyExample of metrics if Prometheus MetricsSink is used: