From 675b1fd3618e214dd327614c27ebb8fe673a6e23 Mon Sep 17 00:00:00 2001 From: Chin-Ya Huang Date: Fri, 4 Oct 2024 17:07:10 +0800 Subject: [PATCH] feat(v2/auto-salvage): retrieve headSvcLvol.UUID when not in cache longhorn/longhorn-8430 Signed-off-by: Chin-Ya Huang --- go.mod | 2 -- go.sum | 2 -- pkg/spdk/replica.go | 5 +++++ vendor/modules.txt | 1 - 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 607e2fe8..eb455779 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,6 @@ go 1.22.0 toolchain go1.23.2 -replace github.com/longhorn/types => github.com/c3y1huang/types v0.0.0-20241027234820-01e88dd78e41 - require ( github.com/0xPolygon/polygon-edge v1.3.3 github.com/google/uuid v1.6.0 diff --git a/go.sum b/go.sum index 0cca21f8..fa0ce3dc 100644 --- a/go.sum +++ b/go.sum @@ -7,8 +7,6 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bits-and-blooms/bitset v1.12.0 h1:U/q1fAF7xXRhFCrhROzIfffYnu+dlS38vCZtmFVPHmA= github.com/bits-and-blooms/bitset v1.12.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/c3y1huang/types v0.0.0-20241027234820-01e88dd78e41 h1:+BCEG+AlV6hbV2RWPVDHvICzMXzkzKv5O2rMNZHg9iU= -github.com/c3y1huang/types v0.0.0-20241027234820-01e88dd78e41/go.mod h1:IpV+1bctQgBgp3brj0nsHmnBDFkd5IrzTgBtVAloJuw= github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8 h1:SjZ2GvvOononHOpK84APFuMvxqsk3tEIaKH/z4Rpu3g= github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8/go.mod h1:uEyr4WpAH4hio6LFriaPkL938XnrvLpNPmQHBdrmbIE= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= diff --git a/pkg/spdk/replica.go b/pkg/spdk/replica.go index 973b20c9..059065f1 100644 --- a/pkg/spdk/replica.go +++ b/pkg/spdk/replica.go @@ -612,6 +612,11 @@ func (r *Replica) Create(spdkClient *spdkclient.Client, portCount int32, superio } headSvcLvol := r.ActiveChain[r.ChainLength-1] + if headSvcLvol.UUID == "" && r.State == types.InstanceStateStopped { + r.log.Debugf("Updating replica %s state from %v to %v because headSvcLvol.UUID is empty", r.Name, r.State, types.InstanceStatePending) + r.State = types.InstanceStatePending + } + // Create bdev lvol if the replica is the new one if r.State == types.InstanceStatePending { var lvsList []spdktypes.LvstoreInfo diff --git a/vendor/modules.txt b/vendor/modules.txt index 7d3e4265..c0473988 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -307,4 +307,3 @@ k8s.io/utils/internal/third_party/forked/golang/net k8s.io/utils/io k8s.io/utils/keymutex k8s.io/utils/net -# github.com/longhorn/types => github.com/c3y1huang/types v0.0.0-20241027234820-01e88dd78e41