Add multi storage driver - #751
Conversation
5a4ed86 to
7038a58
Compare
7038a58 to
d1c81c3
Compare
d1c81c3 to
236a3d7
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces a new “multi” storage driver intended to support migration between two storage backends, and extends the storage driver interface to provide validation-time reads that can trigger on-demand migration.
Changes:
- Added
ReadBlobForValidation/ReadManifestForValidationtokeppel.StorageDriverand updated validation paths to use them. - Introduced a new
internal/drivers/multistorage driver that can read from the “new” backend first and fall back to “old”, copying on first validation. - Centralized the blob chunk size constant as
keppel.ChunkSizeBytes.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/processor/manifests.go | Uses ReadManifestForValidation() during manifest validation to enable migration-on-validation. |
| internal/processor/blobs.go | Uses ReadBlobForValidation() during blob validation; switches chunking to keppel.ChunkSizeBytes. |
| internal/keppel/utils.go | Defines ChunkSizeBytes as a shared chunking constant. |
| internal/keppel/storage_driver.go | Extends the StorageDriver interface with validation-specific read methods. |
| internal/drivers/trivial/storage.go | Implements the new validation read methods by delegating to existing reads. |
| internal/drivers/openstack/swift.go | Implements the new validation read methods by delegating to existing reads. |
| internal/drivers/filesystem/storage.go | Implements the new validation read methods by delegating to existing reads. |
| internal/drivers/multi/storage.go | Adds the new multi storage driver with migration-on-validation logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5ecd182 to
4e3a95f
Compare
85dfbbd to
f20270e
Compare
majewsky
left a comment
There was a problem hiding this comment.
Please split the introduction of keppel.NotFoundInStorageError into a separate PR. Here are comments specifically on that part:
f20270e to
c8ff559
Compare
|
The new error type and the feedback all went into #761 |
0b950ad to
715a244
Compare
ade6476 to
6a9178a
Compare
majewsky
left a comment
There was a problem hiding this comment.
These are my notes for the file internal/drivers/multi/storage.go. Overall, I'm very happy with the overall implementation quality; most of my notes are just papercuts and nitpicks. Once these are addressed and the PR is rebased on main, I will have a look at the remaining bits and pieces, but we should be good to go here soon.
There was a problem hiding this comment.
There should be documentation for this driver. You can leave this to me if you're not into technical writing; I'm just putting this here so we don't forget.
3f955c3 to
1bb98f2
Compare
1bb98f2 to
e41ca62
Compare
Merging this branch will not change overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. |
No description provided.