Repository navigation
fix(linstor): mark volumes restored from a snapshot DRBD-initialized - #4866
Aleksei Sviridkin (lexfrei) wants to merge 1 commit into
Conversation
linstor-csi restores a snapshot on one node and autoplaces the other replicas. In LINSTOR v1.33.3 the restored volume definition has no DRBD_INITIALIZED flag, so the initial UpToDate race is still open, and Linstor/Drbd/InitialUptoDateOn, copied from the source volume through the snapshot, names the node that won it for the source. When a replica is autoplaced on that node, the empty new volume wins the race: it gets a random current UUID and a fresh filesystem, and goes StandAlone against the restored replica. A pod attached there sees an empty volume. Backport the upstream fix, released in LINSTOR v1.34.0, which sets the flag on a restore unless the resource definition asks for new metadata through ForceInitialSyncPermanent, as a backup does. Nothing wins the race any more, and an autoplaced replica resyncs from the restored one like any replica added to an existing volume. Link: LINBIT/linstor-server@9d8cdf5 Closes: #4862 Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to This backports an upstream fix so restored snapshot volumes no longer risk an empty replica winning the initial sync. No actionable merge-blocking risk was found, and volumes restored before the fix still need the separate remediation steps. Pre-merge checks |
|
What this PR does
Restoring a PVC from a LINSTOR VolumeSnapshot can leave one replica with an empty volume that DRBD marks UpToDate. A pod that lands on that replica sees an empty filesystem.
linstor-csi restores the snapshot on one node and autoplaces the other replicas. LINSTOR v1.33.3 copies
Linstor/Drbd/InitialUptoDateOnfrom the source volume into the restored volume definition and leaves the definition withoutDRBD_INITIALIZED. When autoplace puts a replica on the node that name points to, that empty new volume wins the initial UpToDate race, gets a random current UUID and a fresh filesystem, and goes StandAlone against the restored replica.LINBIT fixed this in v1.34.0. This PR backports that commit, LINBIT/linstor-server@9d8cdf5, to our v1.33.3 build as a patch. The README entry says to drop the patch with the move to v1.34.0 or later.
Tested on a three-node cluster with a thick ZFS pool and
placementCount: 3. Before the change the reproduction failed every time. With the patch I ran 5 restores, 4 of them with the source volume's winner on a different node than the restore. I also restored a snapshot taken before the change, and a 10Gi volume. Every time all replicas came up connected and UpToDate, a pod on each node read the same checksum, and the backing zvols were byte-identical when read withO_DIRECT. The resync after a restore moves about the written data, around 40 s for 1Gi and 134 s for 7.5 GiB on 10Gi. CSI clone PVC-to-PVC was checked too and is not affected.There is no e2e test. Every e2e lane runs without DRBD (
COZY_LINSTOR_DRBD_ENABLED=false, StorageClasslocal), so a suite for replicated restores would never run in CI.Volumes restored before this fix are not repaired by it. How to find and fix them is in this comment.
Known limitation, shared by upstream v1.34 since that code did not change: the autoplaced replicas skip the initial sync and rely on the source volume's day0 UUID still being in the restored replica's history. If that ever fails, DRBD goes StandAlone with "unrelated data" instead of syncing, which is visible, not silent. I could not reproduce it.
Closes #4862
Screenshots
Not a UI change.
Downstream repositories
Release note
Summary by CodeRabbit