Skip to content

[Backport release-1.5] fix(seaweedfs): adopt legacy workloads in place across the 4.31 rename - #3326

Closed
github-actions[bot] wants to merge 3 commits into
release-1.5from
backport-3282-to-release-1.5
Closed

[Backport release-1.5] fix(seaweedfs): adopt legacy workloads in place across the 4.31 rename#3326
github-actions[bot] wants to merge 3 commits into
release-1.5from
backport-3282-to-release-1.5

Conversation

@github-actions

Copy link
Copy Markdown

Description

Backport of #3282 to release-1.5.

@github-actions

Copy link
Copy Markdown
Author

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-3282-to-release-1.5
git worktree add --checkout .worktree/backport-3282-to-release-1.5 backport-3282-to-release-1.5
cd .worktree/backport-3282-to-release-1.5
git reset --hard HEAD^
git cherry-pick -x 72db724d5fae4b7be1235c328a6b660a10e611f2 5dc363d3980bdfb54eaff3e98e522c58c0cea5e0
git push --force-with-lease

@myasnikovdaniil
myasnikovdaniil force-pushed the backport-3282-to-release-1.5 branch from f50af9d to f2d21ed Compare July 16, 2026 17:21
@github-actions github-actions Bot added area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) area/storage Issues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor) kind/bug Categorizes issue or PR as related to a bug size/XL This PR changes 500-999 lines, ignoring generated files labels Jul 16, 2026
@myasnikovdaniil
myasnikovdaniil marked this pull request as ready for review July 27, 2026 15:24
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@dosubot dosubot Bot added the backport Should change be backported on previous release label Jul 27, 2026
Upstream chart 4.31 switched resource names from the chart name to the release
name. The data-plane release is <name>-system, so every StatefulSet was renamed
to <name>-system-*. StatefulSet names are immutable, so the upgrade could not
rename in place: Helm stood up a second, empty set beside the running one while
the data stayed on the original data1-seaweedfs-volume-* PVCs. Where the node
count let both sets run, they shared one S3 Service and one filer metadata
database, so the empty set answered reads and mixed volume IDs from an
independent sequence into shared metadata.

Pin fullnameOverride so the rendered names no longer follow the release name,
matching the convention already used by other system packages (cozy-proxy,
flux-operator, linstor-scheduler, victoria-metrics-operator).

The s3-consumer suite pinned the name/fullname divergence this override removes
by default, so it now re-creates that divergence explicitly and keeps guarding it
regardless of the shipped default.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
(cherry picked from commit 7bcd8e0)
(cherry picked from commit 1da45ead8262334636919c097019afdf71da412e)
With the chart-based names pinned back, an upgrade adopts the running workloads
and their volumes in place. Before 4.31 the chart ignored the release name, so
this holds for an instance running under any name: its data sits on the
chart-named data1-seaweedfs-volume-* PVCs either way.

Two states cannot be adopted and stop the render instead, each pointing the
operator at the matching recovery step:

- Fresh on 1.5.x: only the renamed volumes exist, so adopting the chart-based
  name would rename the workloads away from that data and bring up an empty
  cluster. Helm cannot move data between PVCs, so the operator is sent to the PV
  re-bind procedure.
- D-split: both sets exist AND the renamed volume servers are live, so they may
  hold objects written through the split endpoint. Adopting would strand them, so
  the operator is sent to reconcile the split first. A duplicate that never served
  (zero ready replicas) is safe to adopt and renders through.

The guard mirrors the chart's fullname helper to recognise what 4.31 named this
instance (the helper appends the chart name when the release name does not
contain it, then truncates), and matches the renamed volumes by shape plus the
chart labels on the StatefulSet rather than reconstructing the exact name.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
(cherry picked from commit 052ce2e)
(cherry picked from commit 5a724e0bc0d43c8afb621a6da4aab5b13a86e774)
Classify each tenant from its volume PVCs, re-bind the volumes of a tenant
installed fresh on 1.5.x so the adopted names pick them up, stop a split cluster
before upgrading it, and clear the leftovers the upgrade cannot remove itself.
The recovery steps select the renamed set by a precise filter and derive secret
names from the fullname helper, so they work for an instance running under a
non-default name and for pooled or zoned volumes.

Co-authored-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
(cherry picked from commit 088669fb5ae5106aa1d4d22e3226488f557e4b02)
@myasnikovdaniil
myasnikovdaniil force-pushed the backport-3282-to-release-1.5 branch from b0bb6a9 to fefabbb Compare July 31, 2026 05:25
myasnikovdaniil added a commit that referenced this pull request Jul 31, 2026
Backport of #3339 onto release-1.5, on top of the #3282 adopt-in-place
fix (#3326).

Three differences from main, all forced by what release-1.5 does not
carry:

  * The repair migration is renumbered 53 -> 45 and stamps 46, since
    release-1.5 tops out at migration 44 with targetVersion 45.
    platform values.yaml goes to targetVersion 46.

  * Migrations 43 and 45 keep release-1.5's inline labelled stamp
    instead of lib/cozystack-version.sh. That helper is the shared
    stamp refactor (#2980), whose backport (#3065) was closed, so it
    does not exist on this branch. Only lib/seaweedfs-db-adopt.sh --
    the part that actually carries the fix -- is sourced.

  * The extra/seaweedfs post-delete cleanup hook and its three tests
    are dropped. The hook arrived with #3092, a breaking change that
    was never backported, so there is nothing here for #3339's changes
    to it to apply to. Comments in lib/seaweedfs-db-adopt.sh and the
    recovery runbook that promised the hook would reclaim an orphaned
    volume are corrected to say it does not on 1.5.x.

The migration renumbering is carried through the shared helper, the
bats suite (STAMP 54 -> 46) and the runbook prose.

Verified locally: helm unittest green for both seaweedfs charts (51 + 16
assertions) including both blind-upgrade guard canaries, and 34 bats
assertions across migration-seaweedfs-db-adopt, seaweedfs-naming-audit
and seaweedfs-guard-parity.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
(cherry picked from commit 88e9fdcbbbff8aeab317b08557ca6bd6c8b5706d)
myasnikovdaniil added a commit that referenced this pull request Jul 31, 2026
Backport of #3339 onto release-1.5, on top of the #3282 adopt-in-place
fix (#3326).

Three differences from main, all forced by what release-1.5 does not
carry:

  * The repair migration is renumbered 53 -> 45 and stamps 46, since
    release-1.5 tops out at migration 44 with targetVersion 45.
    platform values.yaml goes to targetVersion 46.

  * Migrations 43 and 45 keep release-1.5's inline labelled stamp
    instead of lib/cozystack-version.sh. That helper is the shared
    stamp refactor (#2980), whose backport (#3065) was closed, so it
    does not exist on this branch. Only lib/seaweedfs-db-adopt.sh --
    the part that actually carries the fix -- is sourced.

  * The extra/seaweedfs post-delete cleanup hook and its three tests
    are dropped. The hook arrived with #3092, a breaking change that
    was never backported, so there is nothing here for #3339's changes
    to it to apply to. Comments in lib/seaweedfs-db-adopt.sh and the
    recovery runbook that promised the hook would reclaim an orphaned
    volume are corrected to say it does not on 1.5.x.

The migration renumbering is carried through the shared helper, the
bats suite (STAMP 54 -> 46) and the runbook prose.

Verified locally: helm unittest green for both seaweedfs charts (51 + 16
assertions) including both blind-upgrade guard canaries, and 34 bats
assertions across migration-seaweedfs-db-adopt, seaweedfs-naming-audit
and seaweedfs-guard-parity.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
(cherry picked from commit 88e9fdcbbbff8aeab317b08557ca6bd6c8b5706d)
@myasnikovdaniil

Copy link
Copy Markdown
Contributor

Closing as superseded by #3370, which merged to release-1.5 as be9094c.

This PR and #3370 were divergent reworks of the same seaweedfs base rather than a clean stack: #3370 carried its own copies of all three commits here plus the rename-fallout commit on top, and its versions were the newer ones — its packages/extra/seaweedfs/templates/seaweedfs.yaml blob matched main exactly, while this branch's did not. Merging #3370 therefore landed everything this PR carried, and merging both would have meant resolving the divergence twice for no gain.

Nothing is lost by closing rather than merging. The original PR this backported, #3282, is still correctly accounted for on the branch: cmd/backport-audit now reports it as backported off the commit subjects #3370 brought across, not as dropped or missing.

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

Labels

area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) area/storage Issues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor) backport Should change be backported on previous release kind/bug Categorizes issue or PR as related to a bug size/XL This PR changes 500-999 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants