fstree: define payload-relative seeker for GetStream - #4165
Conversation
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 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.ReadSeekCloserthrough 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 { |
| } | ||
|
|
||
| if pos < p.pos { | ||
| if err := p.resetStream(); err != nil { |
There was a problem hiding this comment.
You can support seeking forward-only, that's sufficient for our purposes. This makes resetter irrelevant.
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>
aae12b3 to
50b5edf
Compare
Closes #3634.