Bug #44508
closedRGW prefetches data for range requests
0%
Description
The problem:
When user is sending GET request with range header bytes=0-1 for example the RGW is trying to fetch the all head object (usually it is 4M).
Reproducer
dd if=/dev/zero of=/tmp/zeros count=1 bs=4M
aws s3 cp /tmp/zeros s3://mybucket --endpoint-url http://rgw_url
aws s3api get-object --bucket mybucket --key zeros --range bytes=0-1 --endpoint-url http://rgw_url output_filename
The RGW logs showing that it reads 4M and not 2 bytes:
2020-03-08T14:25:45.387+0200 7f0088f09700 1 -- 10.46.10.199:0/325646556 --> [v2:10.46.10.199:6800/31564,v1:10.46.10.199:6801/31564] -- osd_op(unknown.0.0:12051 6.4 6:232cb0ff:::f2816f20-5421-4ade-a31f-dde020a68a0c.4157.1_zeros:head [getxattrs,stat,read 0~4194304] snapc 0=[] ondisk+read+known_if_redirected e644) v8 -- 0x7f031401a690 con 0x2355340
2020-03-08T14:25:45.470+0200 7f032ffff700 1 -- 10.46.10.199:0/325646556 <== osd.0 v2:10.46.10.199:6800/31564 12052 ==== osd_op_reply(12051 f2816f20-5421-4ade-a31f-dde020a68a0c.4157.1_zeros [getxattrs out=902b,stat out=16b,read 0~4194304 out=4194304b]