Skip to content

fstree: define payload-relative seeker for GetStream - #4165

Open
End-rey wants to merge 1 commit into
masterfrom
fstree-io-seeker
Open

fstree: define payload-relative seeker for GetStream#4165
End-rey wants to merge 1 commit into
masterfrom
fstree-io-seeker

Conversation

@End-rey

@End-rey End-rey commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Closes #3634.

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.23810% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 30.38%. Comparing base (db2dd63) to head (50b5edf).

Files with missing lines Patch % Lines
pkg/local_object_storage/blobstor/fstree/util.go 95.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4165      +/-   ##
==========================================
+ Coverage   30.32%   30.38%   +0.06%     
==========================================
  Files         673      673              
  Lines       40673    40693      +20     
==========================================
+ Hits        12333    12364      +31     
+ Misses      28340    28329      -11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

🟡 Changes recommended

Seeking beyond the payload has inconsistent behavior across physical storage representations.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Defines payload-relative seeking for FSTree payload streams.

Changes:

  • Exposes io.ReadSeekCloser through FSTree and blob storage interfaces.
  • Adds payload-relative seeking with stream reset support.
  • Expands tests across object layouts and compression modes.
File summaries
File Description
pkg/local_object_storage/shard/shard_internal_test.go Updates blob-store test mocks.
pkg/local_object_storage/blobstor/fstree/util.go Implements payload-relative seeking.
pkg/local_object_storage/blobstor/fstree/head.go Wraps raw streams with the new seeker.
pkg/local_object_storage/blobstor/fstree/getstream_test.go Tests seeking across storage representations.
pkg/local_object_storage/blobstor/fstree/fstree.go Documents and exposes seekable streams.
pkg/local_object_storage/blobstor/common/storage.go Updates the storage interface return type.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

}
}
if pos > p.pos {
if _, err := p.reader.Seek(pos-p.pos, io.SeekCurrent); err != nil {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

}

if pos < p.pos {
if err := p.resetStream(); err != nil {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can support seeking forward-only, that's sufficient for our purposes. This makes resetter irrelevant.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Guarantee that `GetStream` seekers operate relative to payload start. Support
forward-only `SeekStart` and `SeekCurrent` consistently across buffered,
combined and compressed objects. Add coverage for all stream paths.

Closes #3634.

Signed-off-by: Andrey Butusov <andrey@nspcc.io>
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.

FSTree io.Seeker behavior

3 participants