Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(auto-salvage): v2 support #675

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/longhorn/go-common-libs v0.0.0-20241102040927-43901cc2fa33
github.com/longhorn/go-spdk-helper v0.0.0-20241103044742-606c0ee8d532
github.com/longhorn/longhorn-engine v1.8.0-dev-20241103
github.com/longhorn/longhorn-spdk-engine v0.0.0-20241023025831-ecc7b8a48d56
github.com/longhorn/longhorn-spdk-engine v0.0.0-20241106035350-4642db182def
github.com/longhorn/types v0.0.0-20241101010532-9e901229a935
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ github.com/longhorn/go-spdk-helper v0.0.0-20241103044742-606c0ee8d532 h1:hAPa1Uc
github.com/longhorn/go-spdk-helper v0.0.0-20241103044742-606c0ee8d532/go.mod h1:hMcAO/kxvkAjW/nL7mYsNonJUQhFSh0rMMQ/A/PjTLI=
github.com/longhorn/longhorn-engine v1.8.0-dev-20241103 h1:Q3RKmiD9SlxJ9bMRA+Rs0gbEFzQek2zkOjkbnuVpcPQ=
github.com/longhorn/longhorn-engine v1.8.0-dev-20241103/go.mod h1:7c7M3uig+IpM252ewuQ3VZIRIWtwuLOOTBmvLm61QZw=
github.com/longhorn/longhorn-spdk-engine v0.0.0-20241023025831-ecc7b8a48d56 h1:R0mtag2TpUqkiPJAQQRj+wnjmr3xvMB3AVH7F39mhho=
github.com/longhorn/longhorn-spdk-engine v0.0.0-20241023025831-ecc7b8a48d56/go.mod h1:lkFlcoa5ZEYH1ufC+sHdG2jd6gIlhtg129L2Uczf6kU=
github.com/longhorn/longhorn-spdk-engine v0.0.0-20241106035350-4642db182def h1:1LmVa0lk1w/zKj9lqEJS5ZdRXGlBK6AIETYCwdbtlbk=
github.com/longhorn/longhorn-spdk-engine v0.0.0-20241106035350-4642db182def/go.mod h1:uGfvDuUPjW4FIfwiNEH1yJA1CjRoDa6g8ndTPJezGdg=
github.com/longhorn/sparse-tools v0.0.0-20241023025917-7951cd783270 h1:F13lddDaeUX8dBwRqOT/aXtb2C1szwqIFgW4KpZgCGw=
github.com/longhorn/sparse-tools v0.0.0-20241023025917-7951cd783270/go.mod h1:iUJCZtOKG/9xv2rfrUAYZntFTzP5dZtvy4Kwe6dMcUc=
github.com/longhorn/types v0.0.0-20241101010532-9e901229a935 h1:s6ngry7kCUdggXRKywHdwt98vjbOZQX8Txq166hxph0=
Expand Down
2 changes: 2 additions & 0 deletions pkg/client/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ type EngineCreateRequest struct {
InitiatorAddress string
TargetAddress string
UpgradeRequired bool
SalvageRequested bool
}

type ReplicaCreateRequest struct {
Expand Down Expand Up @@ -147,6 +148,7 @@ func (c *InstanceServiceClient) InstanceCreate(req *InstanceCreateRequest) (*api
Size: req.Size,
ReplicaAddressMap: req.Engine.ReplicaAddressMap,
Frontend: req.Engine.Frontend,
SalvageRequested: req.Engine.SalvageRequested,
}
case types.InstanceTypeReplica:
spdkInstanceSpec = &rpc.SpdkInstanceSpec{
Expand Down
2 changes: 1 addition & 1 deletion pkg/instance/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (ops V2DataEngineInstanceOps) InstanceCreate(req *rpc.InstanceCreateRequest
switch req.Spec.Type {
case types.InstanceTypeEngine:
engine, err := c.EngineCreate(req.Spec.Name, req.Spec.VolumeName, req.Spec.SpdkInstanceSpec.Frontend, req.Spec.SpdkInstanceSpec.Size, req.Spec.SpdkInstanceSpec.ReplicaAddressMap,
req.Spec.PortCount, req.Spec.InitiatorAddress, req.Spec.TargetAddress, req.Spec.UpgradeRequired)
req.Spec.PortCount, req.Spec.InitiatorAddress, req.Spec.TargetAddress, req.Spec.UpgradeRequired, req.Spec.SpdkInstanceSpec.SalvageRequested)
if err != nil {
return nil, err
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

494 changes: 284 additions & 210 deletions vendor/github.com/longhorn/longhorn-spdk-engine/pkg/spdk/engine.go

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ github.com/longhorn/longhorn-engine/pkg/sync
github.com/longhorn/longhorn-engine/pkg/types
github.com/longhorn/longhorn-engine/pkg/util
github.com/longhorn/longhorn-engine/pkg/util/disk
# github.com/longhorn/longhorn-spdk-engine v0.0.0-20241023025831-ecc7b8a48d56
# github.com/longhorn/longhorn-spdk-engine v0.0.0-20241106035350-4642db182def
## explicit; go 1.22.0
github.com/longhorn/longhorn-spdk-engine/pkg/api
github.com/longhorn/longhorn-spdk-engine/pkg/client
Expand Down