feat: support snapshot max count for v2#1391
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for configuring and enforcing a maximum snapshot count for the V2 (SPDK) data engine, aligning instance-manager’s proxy/instance flows with the new SPDK RPC and engine-side enforcement needed for longhorn/longhorn#12921.
Changes:
- Extend V2 instance spec and SPDK RPC to carry
SnapshotMaxCount, and plumb it through engine creation and volume get responses. - Add a new SPDK gRPC method to update an engine’s snapshot max count at runtime, and enforce the limit during snapshot creation.
- Update vendored dependencies and module metadata (currently includes local-path replaces).
Reviewed changes
Copilot reviewed 4 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Adds local replace directives for types and longhorn-spdk-engine. |
| go.sum | Dependency checksum updates/removals from module graph changes. |
| vendor/modules.txt | Vendor metadata updates; now records local-path replacements. |
| vendor/github.com/longhorn/types/pkg/generated/spdkrpc/spdk_grpc.pb.go | Adds SPDKService RPC wiring for EngineSnapshotMaxCountSet. |
| vendor/github.com/longhorn/types/pkg/generated/imrpc/instance.pb.go | Adds snapshot_max_count to SpdkInstanceSpec. |
| vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/server_engine.go | Plumbs SnapshotMaxCount into engine creation and adds server handler for updating it. |
| vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/engine.go | Stores SnapshotMaxCount, exposes it via EngineGet, and enforces it in snapshot precheck. |
| vendor/github.com/longhorn/longhorn-spdk-engine/pkg/client/client_engine.go | Extends EngineCreate and adds EngineSnapshotMaxCountSet client call. |
| vendor/github.com/longhorn/longhorn-spdk-engine/pkg/api/types.go | Exposes SnapshotMaxCount in the API engine struct conversion. |
| pkg/instance/instance.go | Passes SnapshotMaxCount into SPDK engine creation for V2 instances. |
| pkg/client/instance.go | Adds SnapshotMaxCount to engine create request and maps it into SpdkInstanceSpec. |
| pkg/proxy/volume.go | Returns SnapshotMaxCount for V2 in VolumeGet and implements V2 VolumeSnapshotMaxCountSet. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| replace github.com/longhorn/types => ../types | ||
|
|
||
| replace github.com/longhorn/longhorn-spdk-engine => ../longhorn-spdk-engine |
88209ef to
71735ce
Compare
Longhorn: 12921 Signed-off-by: David Cheng <david.cheng@suse.com>
71735ce to
5e39929
Compare
|
@mergify backport v1.12.x |
✅ Backports have been createdDetails
Cherry-pick of 1ecf693 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
Which issue(s) this PR fixes:
longhorn/longhorn#12921
What this PR does / why we need it:
Special notes for your reviewer:
Additional documentation or context