Skip to content

fix(satellite): resize only a DRBD device short of its definition - #333

Open
Andrei Kvapil (kvaps) wants to merge 1 commit into
mainfrom
fix/resize-only-a-short-device
Open

Andrei Kvapil (kvaps) wants to merge 1 commit into
mainfrom
fix/resize-only-a-short-device

Conversation

@kvaps

Copy link
Copy Markdown
Member

A restore with grow logged Apply per-resource failure ... drbdadm resize --assume-clean ...: Failure: (130) Resize not allowed during resync once for every restored volume, followed by ApplySucceeded a moment later.

The replica that hits it is the one placed on a node without the snapshot. It receives the snapshot from a peer at the snapshot's size, its backing grows to the definition before its first activation creates the metadata, and the device then attaches at the definition's size. The pass still ran drbdadm resize after the attach because its backing had grown. When that replica was a tiebreaker witness taken over by the placement (linstor-csi adds the preferred-segment replica alone and the rest with a second autoplace, so the definition briefly has two diskful replicas and gets a witness), it was already connected and resyncing by then, and DRBD refused the resize. The refusal changes nothing in the kernel, but it shows up as a Warning on every such restore.

The resize now runs only when some volume's DRBD device, read from sysfs, is smaller than its definition. That is the condition LINSTOR resizes on (DrbdLayer.needsResize, TOO_SMALL). A device that cannot be measured still gets the resize, so a grow whose resize failed is retried as before.

Test: TestApplyResizesOnlyADeviceShortOfTheDefinition grows a backing held at the old size and checks that drbdadm resize runs when the device stays short and does not run when the device already reports the definition. It fails without the change.

A restore received from another node arrives at the snapshot's size,
and its backing grows to the definition before the replica's first
activation creates metadata on it, so the device attaches at the new
size. The pass still ran `drbdadm resize` after the attach because
its backing had grown, and when the replica was already connected
(a tiebreaker witness taken over by the placement) it was resyncing
by then: DRBD refused with "Resize not allowed during resync" and
every such restore logged a failed apply.

Resize only when some volume's DRBD device, read from sysfs, is
smaller than its definition, as LINSTOR does. A device that cannot
be measured still gets the resize.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d313c19c-b8d6-4bba-beac-f5e048a1c714
Commits

Reviewing files that changed from the base of the PR and between d1b8e1d and dfc83ff.

Files selected for processing: 3

  • pkg/satellite/grow.go
  • pkg/satellite/reconciler.go
  • pkg/satellite/reconciler_grow_pending_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant