Backport of 'Cache the previous chunk in Gitlab::HttpIO' (19.3)

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. This is an ordinary patch-release backport into the current stable release (19.3) and needs no exception; it must merge after !251898 (merged), which it targets.

What this backports

This backports the flag removal !251685 (merged) (squashed as commit 2019e867). 19.3.0 already ships the code from !248610 (merged), so this MR only deletes the flag and its definition. 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; the resulting lib/gitlab/http_io.rb is byte-identical to current master. This MR is stacked on !251898 (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

One conflict, the flag assignment in Gitlab::HttpIO#initialize, resolved by dropping it; it conflicts only with the sibling flag removal it is stacked on. The resulting file is byte-identical to current master.

Why this version needs it

19.3 is the current stable release. Both flags are gitlab_com_derisk type and default to disabled, so 19.3.0 as released ships both fixes switched off for every self-managed and Dedicated installation. This MR is what turns the previous-chunk cache on for those installations.

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
  • This MR has been approved by a maintainer (only one approval is required).
  • Ensure the e2e:test-on-omnibus-ee job 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:

Edited by Hordur Freyr Yngvason

Merge request reports

Loading
Loading