Skip to content

refactor: move empty extent trimming to ExtentList - #1128

Merged
jranson merged 2 commits into
trickstercache:mainfrom
shiyudesu:refactor/trim-empty-extents
Sep 3, 2026
Merged

refactor: move empty extent trimming to ExtentList#1128
jranson merged 2 commits into
trickstercache:mainfrom
shiyudesu:refactor/trim-empty-extents

Conversation

@shiyudesu

Copy link
Copy Markdown
Contributor

Description

Move the empty extent filtering logic from the delta proxy cache implementation into timeseries.ExtentList.

This change:

  • adds ExtentList.TrimEmptyExtents();
  • updates fetchExtents to use the new method;
  • removes the standalone trimEmptyExtents function from deltaproxycache.go;
  • adds table-driven unit tests covering interspersed empty extents, all-empty lists, empty lists, and lists without empty extents.

This keeps the existing behavior while making ExtentList responsible for managing its own representation.

Closes #1126

Type of Change

    • Bug fix
    • New feature
    • Optimization
    • Test coverage
    • Documentation
    • Infrastructure

Testing

  • make build
  • make lint
  • make test
  • make data-race-test

All checks pass. The project test suite reports 91.02% statement coverage, and TrimEmptyExtents has 100% statement coverage.

AI Disclosure

    • This contribution DOES NOT include AI-generated changes
    • This contribution DOES include AI-generated changes, and I have reviewed the relevant contributing guidelines.

Signed-off-by: shiyudesu <ming051017@outlook.com>
@shiyudesu
shiyudesu requested a review from a team as a code owner September 3, 2026 02:50
Comment thread pkg/timeseries/extent_list.go Outdated
Signed-off-by: shiyudesu <ming051017@outlook.com>
@shiyudesu
shiyudesu requested a review from jranson September 3, 2026 06:55
@jranson

jranson commented Sep 3, 2026

Copy link
Copy Markdown
Member

integration test failures appear unrelated to this change, so we'll resolve them separately

--- FAIL: TestPCFNeverCollapsesPost
--- FAIL: TestPCFRefusesIneligibleResponses

@jranson
jranson merged commit e89b5f8 into trickstercache:main Sep 3, 2026
13 of 15 checks passed
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.

Move trimEmptyExtents logic to pkg/timeseries/extent_list.go

2 participants