Repository navigation
fix(satellite): refresh MetadataCreated with the resource's own name - #290
Conversation
The startup backfill passed the Resource CR name, `<rd>.<node>`, to `drbdadm dump-md`. The .res file defines the resource under the definition's key, so drbdadm answered "not defined in your config" for every replica and none was ever stamped: on an adopted cluster each satellite start logged one failed probe per replica missing the Condition, and those replicas kept no Condition at all. Probe the name the apply chain renders, per volume as ensureMetadata does, since a resource-wide dump-md answers for the first volume only and an attached volume 0 would vouch for an empty volume 1. Diskless replicas and definitions without a DRBD layer have nothing to probe and are skipped instead of logging the same failure on every start. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
An empty layer stack means the default DRBD-over-storage stack: the controller leaves it unset when the resource group names none, which is the case for a definition adopted from LINSTOR in the default group, and the apply chain renders a .res for it. The backfill read an empty stack as "no DRBD" and skipped those replicas silently, so their missing MetadataCreated Condition stayed missing. Use the same check the resource reconciler uses. The probe-failure log line also names the volume it probed. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
The startup backfill now reaches drbdmeta, and HasMD reads a lower disk it cannot open exclusively as one carrying metadata. Two drbdadm probes of one resource are already kept apart by drbdmeta's per-minor lock, which it takes before opening the disk. Lockless openers in the apply pass are not, so a probe running beside a pass that is about to create the metadata could stamp an empty volume, and that stamp turns create-md off for the replica for good. The reconciler now holds a per-resource lock for each apply pass, and the backfill probes and stamps under the same lock. LINSTOR never probes a resource while its device manager is adjusting it either. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
|
Warning Review limit reachedYou'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 3 minutes. View limit details
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. |
Aleksei Sviridkin (lexfrei)
left a comment
There was a problem hiding this comment.
The probe name now matches what the dispatcher renders, both sides lock the same key, and the per-volume probe matches LINSTOR's per-volume hasMetaData check. LGTM.
The base branch was changed.
Aleksei Sviridkin (lexfrei)
left a comment
There was a problem hiding this comment.
Same head as my earlier approval, which the retarget to main dismissed. The probe name matches what the dispatcher renders, both sides lock the same key, and the per-volume probe matches LINSTOR's per-volume hasMetaData check. It merges cleanly onto current main, and the reconciler setup main moved into setupReconcilers still shares the one ApplyLocks. LGTM.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Aleksei Sviridkin (lexfrei)
left a comment
There was a problem hiding this comment.
LGTM. Same patch as my approval at ab54040, merged with current main for a fresh CI run before merging.
What this fixes
The startup backfill that stamps the
MetadataCreatedCondition never stamped anything. It passed the Resource CR name,<rd>.<node>, todrbdadm dump-md, and drbdadm only knows the resource under the name the.resfile gives it, the definition's key. Every probe failed with'<rd>.<node>' not defined in your config (for this host), logged asdump-md probe failed (best-effort)once per replica on every satellite start, and a replica missing the Condition kept missing it.On the cluster where it was seen, a cluster adopted from LINSTOR, every DRBD replica already carries the Condition, stamped by the apply pass. The replicas without it are all storage-only ones, which have no DRBD metadata and need no Condition, and they were the source of the 16 to 20 failed probes per node on each start. There the change ends that noise. On a cluster where an apply pass failed to stamp the Condition, the backfill now does what it was meant to do.
Changes
naming.Keyof the definition name, the same name the dispatcher puts in the desired resource), so the.resfile is found and a replica with metadata is stampedMetadataFound.<rd>/<vol>) from the definition's volume list and stamps only when every volume has metadata. This is whatensureMetadataalready does: a resource-widedump-mdstops at the first volume, so an attached volume 0 would vouch for an empty volume 1. LINSTOR also checks metadata per volume (DrbdLayer.hasMetaData)..resto probe, and with the right name they would otherwise log a failed probe on every start in place of the old one. An empty layer stack counts as the default DRBD-over-storage stack, as it does everywhere else in the satellite (rdNeedsDRBD): the controller leaves the stack unset when the group names none, which is the case for a definition adopted from LINSTOR in the default group.Why the lock
HasMDreads a lower disk it cannot open exclusively as one carrying metadata, because that is what an attached disk looks like. If the backfill misread a fresh disk that way and stamped it,firstActivationwould turn false and create-md would never run for that replica. Twodrbdadm dump-mdcalls on one resource cannot cause that: drbdmeta takes its per-minor lock before it opens the disk (dt_lock_drbdinmain, ahead of the command'sopen), so the second waits up to a second or exits withlock on ... currently held by pid, whichHasMDreports as an unrecognised failure and the caller retries. Other openers in the apply pass run outside that lock, though, such as the minor-lessdrbdmeta -calls and the storage layer's own tools. Proving each of them harmless is more fragile than not probing during an apply pass at all, which is also how LINSTOR behaves: its device manager never probes a resource while adjusting it.The cost is that the startup backfill waits for an apply pass in progress on the same resource, and an apply pass waits for the backfill's few
dump-mdcalls on it. Different resources do not wait for each other.Behaviour notes
CreateMdSucceededbefore fix(satellite): reconcile a new resource within seconds on a busy node #277 keeps that Reason; the backfill only fills in a missing Condition.CreateMdSucceededbetween that List and the backfill reaching the replica, the backfill restamps it asMetadataFound. The Condition stays True and nothing reads the Reason, so only the audit trail changes..resyet and the probe logs a failure on that start; the replica is not stamped.Interactions
MetadataFoundReason and the backfill's use of it. Should merge after it.pkg/satellite/controllers/resource.go, and fix(storage)!: delete storage only on request, the way LINSTOR does #271 editsmanager.go. None of them touch the lines changed here (theApplycall inrunApply,ensureWiredDefaults, the backfill registration), so at most a textual rebase is expected.Testing
make lint-config && make lint: 0 issues.go test ./...with envtest assets: green, including thepkg/namingprovenance guard.<rd>/<vol>for a plain and a hashed definition name, and the Condition readsMetadataFound(fails on the previous code, which probes<rd>.<node>and stamps nothing);dump-mdruns while the resource's lock is held;runApplyholds the resource's lock while the apply pass creates the volume;Not tested