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.
| reader, sizeBytes, err := d.newDriver.ReadBlob(ctx, account, storageID) | ||
| if errors.Is(err, os.ErrNotExist) { | ||
| reader, sizeBytes, err = d.oldDriver.ReadBlob(ctx, account, storageID) | ||
| if err != nil { |
There was a problem hiding this comment.
@majewsky that should not be a problem for us, right? Or do we want to write tests e2e tests for this?
236a3d7 to
5ecd182
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.