-
Notifications
You must be signed in to change notification settings - Fork 17
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
fix: reconstruct the cache for failed replica restarting #296
Conversation
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]>
WalkthroughThe pull request introduces modifications to the Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
pkg/spdk/replica.go (1)
806-807
: Consider adding a log message before or after reconstruction.This ensures better observability and debugging during replica reuse or restart scenarios. For example, logging both before and after the
construct()
call can help track the state transitions and potential failures.... + r.log.Infof("Attempting to reconstruct failed replica %s", r.Name) bdevLvolMap, err := GetBdevLvolMapWithFilter(spdkClient, r.replicaLvolFilter) if err != nil { return nil, err } if err := r.construct(bdevLvolMap); err != nil { return nil, err } + r.log.Infof("Successfully reconstructed failed replica %s", r.Name) r.State = types.InstanceStateStopped ...
Which issue(s) this PR fixes:
Issue longhorn/longhorn#9488
What this PR does / why we need it:
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.
Special notes for your reviewer:
Additional documentation or context