Skip to content

[Backport release-1.2] [Backport release-1.3] fix(linstor): retry drbdadm secondary after mkfs on transient EBUSY - #2581

Closed
github-actions[bot] wants to merge 1 commit into
release-1.2from
backport-2579-to-release-1.2
Closed

github-actions[bot] wants to merge 1 commit into
release-1.2from
backport-2579-to-release-1.2

Conversation

@github-actions

@github-actions github-actions Bot commented May 6, 2026

Copy link
Copy Markdown

Description

Backport of #2579 to release-1.2.

LINSTOR satellite aborts resource initialization with "Device is held open
by someone" (errno -12) when an external probe (Talos block-controller,
udev, multipathd) opens the freshly-promoted DRBD device just before the
post-mkfs demotion. The controller view then stays in SyncTarget /
Inconsistent / DELETING indefinitely, blocking cleanup of orphan PVs in
Released phase.

Add a retry wrapper secondaryAfterMkfs() with exponential backoff
(7 attempts, 250ms -> 2s) that triggers only on this specific error
message. DrbdPrimary.close() now uses the wrapper so the retry only
applies to the post-mkfs demotion path; the existing public secondary()
contract is untouched.

Related: LINBIT/linstor-server#268, LINBIT/drbd#74
Signed-off-by: IvanHunters <[email protected]>
(cherry picked from commit 90fbb16)
(cherry picked from commit 972e070)
@dosubot dosubot Bot added area/storage Issues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor) kind/backport Categorizes issue or PR as requiring a backport to the current release line kind/backport-previous Categorizes issue or PR as requiring a backport to the previous release line kind/bug Categorizes issue or PR as related to a bug labels May 6, 2026
@myasnikovdaniil

Copy link
Copy Markdown
Contributor

Duplicate

Aleksei Sviridkin (lexfrei) added a commit that referenced this pull request May 6, 2026
## What this PR does

Fix the cascade where merging a backport PR (e.g. #2579) spawns another
backport (e.g. #2581 `[Backport release-1.2] [Backport release-1.3] …`).

Two compounding issues:

1. `pr-labeler.yaml` auto-added the `backport` label to any PR whose
title started with `[Backport release-X.Y]` — exactly the prefix
`korthout/backport-action` puts on every backport PR. Introduced in
`c8ed1c65` (CNCF/k8s label conventions). Fixed by dropping that
`toAdd.add('backport')` line.
2. `dosubot[bot]` independently re-applies `backport-previous` to
backport PRs based on similarity to the parent PR; it cannot be
controlled from this repo. Fixed by gating both jobs in `backport.yaml`
on `pull_request.base.ref == 'main'`, so backport PRs (which target
`release-X.Y`) cannot trigger the workflow regardless of labels.

Verified pre-fix behaviour by inspecting the label-event timeline of
#2580 (dosubot adds `backport-previous` 47s after PR open) and the diff
of `c8ed1c65` adding `pr-labeler.yaml`.

### Release note

```release-note
fix(ci): backport automation no longer creates duplicate backport PRs when a backport PR is merged.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Enhanced backport automation workflow with additional safety checks to
ensure operations only process pull requests targeting the main branch.
* Simplified pull request labeling workflow to streamline label
assignment logic.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
pull Bot pushed a commit to medampudi/cozystack that referenced this pull request May 6, 2026
Two compounding issues caused merging a backport PR to spawn another
backport (e.g. cozystack#2581 [Backport release-1.2] [Backport release-1.3] ...
from cozystack#2579):

1. pr-labeler auto-added the `backport` label to any PR whose title
   started with `[Backport release-X.Y]` (regression introduced in
   c8ed1c6 when pr-labeler.yaml was first added). korthout/backport-
   action puts that prefix on every backport PR it creates, so the
   label was being re-applied to every backport, satisfying the
   workflow's gate when the backport itself was merged.

2. Even with that fixed, an external labeling bot (dosubot) still
   re-applies `backport-previous` to backport PRs based on similarity
   to the parent. That bot is configured at the org level and cannot
   be controlled from this repo.

Drop the `toAdd.add('backport')` line from pr-labeler so the label
isn't propagated by us, and gate both backport jobs on
`pull_request.base.ref == 'main'` so backport PRs (which target
release-X.Y) cannot trigger the workflow regardless of what labels
end up on them.

Assisted-By: Claude <[email protected]>
Signed-off-by: Myasnikov Daniil <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/storage Issues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor) kind/backport Categorizes issue or PR as requiring a backport to the current release line kind/backport-previous Categorizes issue or PR as requiring a backport to the previous release line kind/bug Categorizes issue or PR as related to a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants