Skip to content

slice: Avoid redundant prefetch re-scheduling - #13215

Merged
zwoop merged 3 commits into
apache:masterfrom
zwoop:SliceFixes
May 29, 2026
Merged

zwoop merged 3 commits into
apache:masterfrom
zwoop:SliceFixes

Conversation

@zwoop

@zwoop zwoop commented May 29, 2026

Copy link
Copy Markdown
Contributor

schedule_prefetch() ran on every server response and re-issued blocks already scheduled this request, which the in-flight dedup set does not catch. Track a per-request high-water mark so each block is prefetched at most once; update the slice_prefetch gold. Supersedes #13212.

schedule_prefetch() ran on every server response and re-issued blocks
already scheduled this request, which the in-flight dedup set does not
catch. Track a per-request high-water mark so each block is prefetched
at most once; update the slice_prefetch gold. Supersedes apache#13212.

Co-authored-by: Masaori Koshiba <masaori@apache.org>
@zwoop zwoop added this to the 11.0.0 milestone May 29, 2026
@zwoop zwoop self-assigned this May 29, 2026
Copilot AI review requested due to automatic review settings May 29, 2026 15:34
@zwoop zwoop added the slice label May 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the slice plugin’s prefetch behavior to avoid re-scheduling the same background-fetch blocks multiple times within a single transaction by tracking a per-request “high-water mark” of prefetched blocks. This addresses redundant prefetch requests that could race with inline reads, and updates the slice_prefetch gold output accordingly.

Changes:

  • Track a per-request prefetch high-water mark in Data so each block is scheduled for prefetch at most once per request.
  • Update schedule_prefetch() to skip blocks at or below the recorded high-water mark and advance the mark after scheduling.
  • Update the slice_prefetch gold file to reflect the new request/response pattern.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/gold_tests/pluginTest/slice/gold/slice_prefetch.gold Updates expected output for slice prefetch behavior changes.
plugins/slice/util.cc Skips redundant prefetch scheduling using a per-request high-water mark and updates it after scheduling.
plugins/slice/Data.h Adds the per-request prefetch high-water mark field.

Comment thread plugins/slice/Data.h

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread plugins/slice/util.cc Outdated
Comment thread plugins/slice/Data.h Outdated
Block numbers are int64_t (Range, Data::m_blocknum); widen the
prefetch high-water mark and loop accordingly and narrow only at the
BgBlockFetch::schedule() boundary. Addresses Copilot review.
@zwoop
zwoop merged commit bcddd98 into apache:master May 29, 2026
15 checks passed
@zwoop
zwoop deleted the SliceFixes branch May 29, 2026 18:47
@github-project-automation github-project-automation Bot moved this to For v10.2.0 in ATS v10.2.x May 29, 2026
@cmcfarlen cmcfarlen removed the status in ATS v10.2.x Jun 16, 2026
@cmcfarlen cmcfarlen moved this to Picked v10.2.0 in ATS v10.2.x Jun 16, 2026
@cmcfarlen cmcfarlen modified the milestones: 11.0.0, 10.2.0 Jun 16, 2026
@cmcfarlen

Copy link
Copy Markdown
Contributor

Cherry-picked to 10.2.x

cmcfarlen pushed a commit that referenced this pull request Jun 16, 2026
* slice: Avoid redundant prefetch re-scheduling

schedule_prefetch() ran on every server response and re-issued blocks
already scheduled this request, which the in-flight dedup set does not
catch. Track a per-request high-water mark so each block is prefetched
at most once; update the slice_prefetch gold. Supersedes #13212.

Co-authored-by: Masaori Koshiba <masaori@apache.org>

* slice: Address Copilot review (m_prefetch_hwm -> int)

* slice: Use int64_t for prefetch block math

Block numbers are int64_t (Range, Data::m_blocknum); widen the
prefetch high-water mark and loop accordingly and narrow only at the
BgBlockFetch::schedule() boundary. Addresses Copilot review.

---------

Co-authored-by: Masaori Koshiba <masaori@apache.org>
(cherry picked from commit bcddd98)
cmcfarlen pushed a commit to cmcfarlen/trafficserver that referenced this pull request Jul 29, 2026
* slice: Avoid redundant prefetch re-scheduling

schedule_prefetch() ran on every server response and re-issued blocks
already scheduled this request, which the in-flight dedup set does not
catch. Track a per-request high-water mark so each block is prefetched
at most once; update the slice_prefetch gold. Supersedes apache#13212.

Co-authored-by: Masaori Koshiba <masaori@apache.org>

* slice: Address Copilot review (m_prefetch_hwm -> int)

* slice: Use int64_t for prefetch block math

Block numbers are int64_t (Range, Data::m_blocknum); widen the
prefetch high-water mark and loop accordingly and narrow only at the
BgBlockFetch::schedule() boundary. Addresses Copilot review.

---------

Co-authored-by: Masaori Koshiba <masaori@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Picked v10.2.0

Development

Successfully merging this pull request may close these issues.

3 participants