Merge pull request #33807 from ofriedma/wip-disable-range-prefetch

rgw: Disable prefetch of entire head object when GET request with ran…

Reviewed-by: Matt Benjamin <mbenjami@redhat.com>
Reviewed-by: Mark Kogan <mkogan@redhat.com>
Reviewed-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
Casey Bodley 2020-04-02 10:46:27 -04:00 committed by GitHub
commit e8811a0cfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2147,22 +2147,14 @@ bool RGWGetObj::prefetch_data()
return false;
}
bool prefetch_first_chunk = true;
range_str = s->info.env->get("HTTP_RANGE");
// TODO: add range prefetch
if (range_str) {
int r = parse_range();
/* error on parsing the range, stop prefetch and will fail in execute() */
if (r < 0) {
return false; /* range_parsed==false */
}
/* range get goes to shadow objects, stop prefetch */
if (ofs >= s->cct->_conf->rgw_max_chunk_size) {
prefetch_first_chunk = false;
}
parse_range();
return false;
}
return get_data && prefetch_first_chunk;
return get_data;
}
void RGWGetObj::pre_exec()