Skip to content

Commit

Permalink
fix: reconstruct the cache for failed replica restarting
Browse files Browse the repository at this point in the history
If the upper layer tries to launch a previously failed replica
in a newly launched instance manager pod. The pod may have no
info then directly treat it as a new replica and skip the cache
reconstruction. Finally, this replica will be failed by
r.validateAndUpdate() in the next moment.

Longhorn 9488

Signed-off-by: Shuo Wu <[email protected]>
  • Loading branch information
shuo-wu authored and innobead committed Dec 31, 2024
1 parent b3271d0 commit ed1b3cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/spdk/replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -803,8 +803,8 @@ func (r *Replica) Create(spdkClient *spdkclient.Client, portCount int32, superio
return nil, err
}

// In case of failed replica reuse being failed by r.validateAndUpdate(), we should make sure the caches are correct.
if r.reconstructRequired {
// In case of failed replica reuse/restart being errored by r.validateAndUpdate(), we should make sure the caches are correct.
if r.State == types.InstanceStatePending && r.reconstructRequired {
bdevLvolMap, err := GetBdevLvolMapWithFilter(spdkClient, r.replicaLvolFilter)
if err != nil {
return nil, err
Expand Down

0 comments on commit ed1b3cb

Please sign in to comment.