Repository navigation
fix(linstor): reconnect only the stalled peer in the satellite plunger - #4184
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe stalled-resync recovery action now reconnects the explicitly selected resource-peer endpoint. ChangesStalled resync recovery
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to Stalled resync recovery now reconnects only the peer it disconnected, avoiding resource-wide reconnect conflicts. No current merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
scooby87
left a comment
There was a problem hiding this comment.
LGTM (independent cozy-review pass).
The fix is correct. disconnect targets a single peer connection (res:peer) while the old connect $res reconnected the whole resource; in the multi-peer stall scenario the whole-resource connect always hits an already-connected peer and fails with exit 10, so the stalled peer stays disconnected forever. Making connect symmetric (res:peer) fixes exactly that. set -e is safe (the line ends in || log) and the operation is data-safe (no backing-storage touch).
Non-blocking note: there is no bats regression test for the plunger scripts (the harness has historically been absent). An invariant test with a stubbed drbdadm would lock down "disconnect and connect target the same res:peer".
Aleksei Sviridkin (lexfrei)
left a comment
There was a problem hiding this comment.
LGTM.
drbdadm takes a connection as resource:connection-name, and with a bare resource it walks every connection of that resource (drbdadm-9.0(8)). So the old line really did reach peers it had not disconnected.
I checked the actual arguments, not just the shape of the line: cut the script at the main loop, source it, stub drbdadm, and drbd_stall_act pvc-abc sb-node-2 90.4 prints disconnect pvc-abc:sb-node-2 followed by connect pvc-abc:sb-node-2. Same pair both times, and not swapped. $peer comes from connections[].name in drbdsetup status --json, which is the peer node name, and that is what a connection name defaults to. Line 92 is also the only connect or disconnect call in the package, so nothing else carries the same asymmetry.
Two things, neither blocking. Your "never reconnected" only follows if drbdadm stops iterating after a failed connection, and I did not confirm that in the source, so the sandbox log is the whole evidence and I can't rerun it. It doesn't change the fix, which is right either way, but this body becomes the merge commit message. And nothing tests the script: the bats runner only picks up hack/*.bats at the repo root, so a test would live there instead of next to the package. The probe above is most of one. Not worth holding a one-line fix for.
The percent-in-sync granularity you mention at the end is a separate problem, leaving it out of scope here.
Aleksei Sviridkin (lexfrei)
left a comment
There was a problem hiding this comment.
LGTM, same verdict. One merge-readiness fact to add.
The two required contexts, pre-commit and E2E Tests, have never posted on this head. Every workflow run on it sits in action_required, which is what a fork PR does until a maintainer approves the runs, so the only checks that reported are size, label and DCO. My approval rests on reading the script and on the stubbed drbdadm probe, not on CI — there is no CI evidence here either way. Those runs need approving before the required checks can report.
drbd_stall_act disconnects one peer with "drbdadm disconnect res:peer" but then runs "drbdadm connect res", which walks every connection of the resource. The peers that are still connected make drbdsetup fail with "Device has a net-config (use disconnect first)" (exit code 10), the helper only logs "WARN: action failed" and the stalled peer stays disconnected. Reconnect the same res:peer pair that was just disconnected. Signed-off-by: Yan Bondarenko <[email protected]>
2beab48 to
8c649df
Compare
74c8724
into
cozystack:main
|
Successfully created backport PR for |
What
drbd_stall_actinpackages/system/linstor/hack/plunger/plunger-satellite.shdisconnects a single peer withdrbdadm disconnect res:peerand then callsdrbdadm connect res, which walks every connection of the resource. Each peer that is still connected makesdrbdsetup connectfail withDevice has a net-config (use disconnect first)(exit code 10), the helper only logsWARN: action failed for res:peer, and the peer that was just disconnected is never reconnected.Observed
cozystack 1.4.6 sandbox, LINSTOR 1.33.2 / DRBD 9.3.2 on Talos 1.13.6, resync of a 20 GiB volume while the Primary keeps writing:
Fix
Reconnect the same
res:peerpair that was disconnected. Verified on the sandbox by patching the livelinstor-plungerConfigMap: the peer reconnects and the resync completes.Note
Not part of this change: the stall detector compares
percent-in-sync, whichdrbdsetup status --jsonreports with one decimal, so a slow resync (for example one throttled down toc-min-rateby application I/O) can look stalled forSTALL_ITERSiterations and trigger a reconnect every couple of minutes. Happy to follow up on that separately if you think it is worth it.Summary by CodeRabbit