Skip to content

Add multi storage driver - #751

Open
SuperSandro2000 wants to merge 1 commit into
masterfrom
multi-storage-driver
Open

Add multi storage driver#751
SuperSandro2000 wants to merge 1 commit into
masterfrom
multi-storage-driver

Conversation

@SuperSandro2000

Copy link
Copy Markdown
Member

No description provided.

@SuperSandro2000
SuperSandro2000 force-pushed the multi-storage-driver branch 3 times, most recently from 5a4ed86 to 7038a58 Compare July 20, 2026 11:02
Comment thread internal/drivers/multi/storage.go Outdated
Comment thread internal/drivers/multi/storage.go Outdated
Comment thread internal/drivers/multi/storage.go Outdated
Comment thread internal/drivers/multi/storage.go Outdated
@SuperSandro2000 SuperSandro2000 changed the title TMP multi storage driver Add multi storage driver Jul 20, 2026
@sapcc sapcc deleted a comment from github-actions Bot Jul 20, 2026
@SuperSandro2000
SuperSandro2000 requested a review from majewsky July 20, 2026 14:36
Comment thread internal/drivers/multi/storage.go
Comment thread internal/drivers/multi/storage.go Outdated
Comment thread internal/drivers/multi/storage.go Outdated
Comment thread internal/drivers/multi/storage.go Outdated

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.

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 / ReadManifestForValidation to keppel.StorageDriver and updated validation paths to use them.
  • Introduced a new internal/drivers/multi storage 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.

Comment thread internal/drivers/multi/storage.go Outdated
Comment thread internal/drivers/multi/storage.go Outdated
Comment thread internal/drivers/multi/storage.go Outdated
Comment thread internal/drivers/multi/storage.go
Comment thread internal/drivers/multi/storage.go Outdated
Comment thread internal/drivers/multi/storage.go Outdated
Comment thread internal/drivers/multi/storage.go Outdated
Comment thread internal/keppel/storage_driver.go
@SuperSandro2000
SuperSandro2000 force-pushed the multi-storage-driver branch 2 times, most recently from 5ecd182 to 4e3a95f Compare July 21, 2026 15:43
Comment thread internal/drivers/filesystem/storage.go Fixed
@SuperSandro2000
SuperSandro2000 force-pushed the multi-storage-driver branch 5 times, most recently from 85dfbbd to f20270e Compare July 28, 2026 23:46

@majewsky majewsky 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.

Please split the introduction of keppel.NotFoundInStorageError into a separate PR. Here are comments specifically on that part:

Comment thread internal/keppel/storage_driver.go Outdated
Comment thread internal/keppel/storage_driver.go
Comment thread internal/keppel/storage_driver.go
Comment thread internal/keppel/storage_driver.go
Comment thread internal/drivers/filesystem/storage.go
Comment thread internal/drivers/filesystem/storage.go Outdated
Comment thread internal/drivers/openstack/swift.go Outdated
Comment thread internal/drivers/openstack/swift.go Outdated
Comment thread internal/drivers/trivial/storage.go
@SuperSandro2000

Copy link
Copy Markdown
Member Author

The new error type and the feedback all went into #761

@SuperSandro2000
SuperSandro2000 force-pushed the multi-storage-driver branch 3 times, most recently from 0b950ad to 715a244 Compare July 30, 2026 11:39
@SuperSandro2000
SuperSandro2000 force-pushed the multi-storage-driver branch 3 times, most recently from ade6476 to 6a9178a Compare July 30, 2026 15:50
@SuperSandro2000
SuperSandro2000 marked this pull request as ready for review July 30, 2026 15:54
@SuperSandro2000
SuperSandro2000 requested a review from a team as a code owner July 30, 2026 15:54
@SuperSandro2000
SuperSandro2000 requested a review from majewsky July 30, 2026 15:54

@majewsky majewsky 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.

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.

Comment thread internal/drivers/multi/storage.go Outdated
Comment thread internal/drivers/multi/storage.go Outdated
Comment thread internal/drivers/multi/storage.go

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.

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.

Comment thread internal/drivers/multi/storage.go Outdated
Comment thread internal/drivers/multi/storage.go
Comment thread internal/drivers/multi/storage.go
@SuperSandro2000
SuperSandro2000 force-pushed the multi-storage-driver branch 2 times, most recently from 3f955c3 to 1bb98f2 Compare August 3, 2026 15:25
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/sapcc/keppel/internal/drivers/filesystem 0.00% (ø)
github.com/sapcc/keppel/internal/drivers/multi 0.00% (ø)
github.com/sapcc/keppel/internal/drivers/openstack 0.00% (ø)
github.com/sapcc/keppel/internal/drivers/trivial 0.00% (ø)
github.com/sapcc/keppel/internal/keppel 83.36% (ø)
github.com/sapcc/keppel/internal/processor 83.72% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/sapcc/keppel/internal/drivers/filesystem/storage.go 0.00% (ø) 0 0 0
github.com/sapcc/keppel/internal/drivers/multi/storage.go 0.00% (ø) 0 0 0
github.com/sapcc/keppel/internal/drivers/openstack/swift.go 0.00% (ø) 0 0 0
github.com/sapcc/keppel/internal/drivers/trivial/storage.go 0.00% (ø) 0 0 0
github.com/sapcc/keppel/internal/keppel/storage_driver.go 66.67% (ø) 132 88 44
github.com/sapcc/keppel/internal/keppel/utils.go 89.19% (ø) 407 363 44
github.com/sapcc/keppel/internal/processor/blobs.go 70.45% (ø) 792 558 234
github.com/sapcc/keppel/internal/processor/manifests.go 84.03% (ø) 2442 2052 390

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.

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.

4 participants