Skip to content

Commit

Permalink
feat(v2/auto-salvage): retrieve headSvcLvol.UUID when not in cache
Browse files Browse the repository at this point in the history
longhorn/longhorn-8430

Signed-off-by: Chin-Ya Huang <[email protected]>
  • Loading branch information
c3y1huang committed Nov 6, 2024
1 parent 1842401 commit 675b1fd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
5 changes: 5 additions & 0 deletions pkg/spdk/replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 675b1fd

Please sign in to comment.