Backport of 'Cache the previous chunk in Gitlab::HttpIO' (19.2)
What does this MR do and why?
Status
Not blocked on anything upstream: both flag-removal MRs, !251684 (merged) and !251685 (merged), merged to master on 2026-08-25 (labelled workflow::production) and are deployed to GitLab.com.
Needs release manager agreement, since it backports into 19.2 (N-1), and must merge after !251864 (merged), which it targets and does not apply without.
What this backports
This backports !248610 (merged) (merged 2026-08-12, released in 19.3.0), together with the flag removal !251685 (merged) (squashed as commit 2019e867). 19.2 has neither. The backport branch is a single commit, squashed to the state after the feature flag was removed, so the stable branch never carries the flag. This MR is stacked on !251864 (merged): it targets that branch rather than the stable branch, so its diff shows only this change, and GitLab will retarget it to the stable branch once the parent merges.
What it changes
Gitlab::HttpIO cached exactly one 128KB chunk. That is fine for a forward read, but a backward scan walks in 4KB steps, and a step straddling a chunk boundary fetched the lower chunk, then the upper one it had just evicted, then the lower one again. Retaining the previously read chunk removes the re-fetches. Measured on an 8MB archived trace of 62 chunks: 184 range GETs (3.0x) and 22.8MB transferred to scan 7.6MB; with the previous chunk retained it is 62 GETs (1.0x). This is the change that reduces external_http_count and object storage egress for archived-trace coverage extraction — connection reuse removes the setup cost of those requests, not the requests themselves.
Rollout evidence
The http_io_previous_chunk_cache feature flag has been at 100% on GitLab.com since 2026-08-13.
Backport notes
Two conflicts, both the flag assignment in Gitlab::HttpIO#initialize, resolved by dropping it.
Why this version needs it
19.2 is N-1 and is the version GitLab Dedicated runs. Both flags are gitlab_com_derisk type and default to disabled, so without this backport GitLab Dedicated keeps running with both fixes switched off. This MR is what turns the previous-chunk cache on for that tenant.
The full set
| Version | Connection reuse | Previous-chunk cache |
|---|---|---|
| 19.2 (N-1, GitLab Dedicated) | !251864 (merged) | !251865 (merged) (stacked) |
| 19.3 (current stable) | !251898 (merged) | !251899 (merged) (stacked) |
Shared context: https://gitlab.com/gitlab-org/gitlab/-/work_items/605350 (Ci::BuildFinishedWorker latency) and #597765 (severity::2, open since 2026-04-22, actively paging a GitLab Dedicated tenant).
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
- This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
- The MR that fixed the bug on the default branch has been deployed to GitLab.com (not applicable for documentation or spec changes).
- The MR title is descriptive (e.g. "Backport of 'title of default branch MR'"). This is important, since the title will be copied to the patch blog post.
- Required labels have been applied to this merge request
- severity label and bug subtype labels (if applicable)
- If this MR fixes a bug that affects customers, the customer label has been applied.
- This MR has been approved by a maintainer (only one approval is required).
- Ensure the
e2e:test-on-omnibus-eejob has succeeded, or if it has failed, investigate the failures. If you determine the failures are unrelated, you may proceed. If you need assistance investigating, request help in the #s_developer_experience Slack channel to confirm the failures are unrelated to the merge request.
Note to the merge request author and maintainer
If you have questions about the patch release process, please:
- Refer to the patch release runbook for engineers and maintainers for guidance.
- Ask questions on the
#releasesSlack channel (internal only). - Once the backport has been merged, the commit changes will be automatically deployed to a release environment that can be used for manual validation. See after merging runbook for details.