Repository navigation
[linstor] Make satellite plunger script continue on errors. - #728
Conversation
Signed-off-by: Denis Seleznev <[email protected]>
WalkthroughThe pull request enhances the error handling within the Changes
Sequence Diagram(s)sequenceDiagram
participant Script as plunger-satellite.sh
participant Command as Shell Command Executor
Script->>Command: Execute `losetup --detach`
Command-->>Script: Return Success/Failure
alt Failure Detach
Script->>Script: Output "Command failed"
end
Script->>Command: Execute `drbdadm down` for secondary volume
Command-->>Script: Return Success/Failure
alt Failure Down
Script->>Script: Output "Command failed"
end
Script->>Command: Execute `drbdadm up` for secondary volume
Command-->>Script: Return Success/Failure
alt Failure Up
Script->>Script: Output "Command failed"
end
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 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
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/system/linstor/hack/plunger/plunger-satellite.sh (2)
29-29: Enhance Error Message for Losetup Detachment
The error-handling in line 29 now prevents the script from exiting on a failed detach operation. However, the generic message"Command failed"makes it harder to identify which command failed during execution. Consider including the command name and the failing device to improve clarity. Additionally, writing the error to stderr can help separate it from normal output.Suggested diff:
- /usr/sbin/losetup --detach "${stale_device}" || echo "Command failed" + /usr/sbin/losetup --detach "${stale_device}" || echo "losetup failed to detach ${stale_device}" >&2
39-40: Improve Error Messaging for DRBDADM Commands
Similar to the previous comment, the error messages for thedrbdadm downanddrbdadm upcommands (lines 39–40) would benefit from being more descriptive. Explicit messages that include the secondary volume identifier will simplify troubleshooting. Redirecting these error messages to stderr is also recommended.Suggested diff:
- drbdadm down "${secondary}" || echo "Command failed" + drbdadm down "${secondary}" || echo "drbdadm down command failed for ${secondary}" >&2- drbdadm up "${secondary}" || echo "Command failed" + drbdadm up "${secondary}" || echo "drbdadm up command failed for ${secondary}" >&2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/system/linstor/hack/plunger/plunger-satellite.sh(1 hunks)
🔇 Additional comments (1)
packages/system/linstor/hack/plunger/plunger-satellite.sh (1)
32-34: Clarify Comments for Secondary Volume Handling
The added comments (lines 32–34) provide clearer context on why secondary volumes with forced I/O failures are being detected and safely recreated. This added documentation increases maintainability and helps any future developer understand the rationale behind this block.
There was a problem hiding this comment.
xy2 what do you think to just remove set -e from the script, instead of explicitly specifying this for every command?
Do not restart the container if something goes wrong while plunger tries to fix the linstor state.
Summary by CodeRabbit