Skip to content

fix: restore s->length > 0 guard in fetch-all detection#6768

Closed
Claude wants to merge 1 commit into
mainfrom
claude/address-comments-in-6767
Closed

fix: restore s->length > 0 guard in fetch-all detection#6768
Claude wants to merge 1 commit into
mainfrom
claude/address-comments-in-6767

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Mar 1, 2026

Reverts the removal of the s->length > 0 guard in OpRange's fetch-all access pattern classification. The guard is intentional behavior.

Changes

  • Restored s->length > 0 && condition in fetch-all detection logic (src/server/stream_family.cc:1294)

Rationale

Empty streams should use the default access_kind classification (typically kRandom), not be classified as fetch-all. The fetch-all classification is specifically for operations that scan all existing entries in a non-empty stream.

Before (incorrect):

if (s->length == 0 || (streamCompareID(&sstart, &s->first_id) <= 0 && ...))

After (correct):

if (s->length > 0 && streamCompareID(&sstart, &s->first_id) <= 0 && ...)

@romange
Copy link
Copy Markdown
Collaborator

romange commented Mar 1, 2026

@claude do not remove s->length > 0 guard

@Claude Claude AI changed the title [WIP] Address comments in pull request #6767 Address review comments on stream access metrics Mar 1, 2026
@Claude Claude AI changed the title Address review comments on stream access metrics fix: restore s->length > 0 guard in fetch-all detection Mar 1, 2026
@romange romange closed this Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants