mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
2e8c3a04696f9f36aa66c2ecac6dc20fdcbdef85
QA round 11 reported the 41045e5 fix didn't take effect — same
ErrStalePrimary as round 10. Reason: my latch condition required
ALL FOUR Identity fields zero, but at EnsureStorage construction
time, AdapterProjectionView.Projection() returns:
VolumeID = cfg.VolumeID ("v1" — non-empty, from CLI)
ReplicaID = cfg.ReplicaID ("r1" — non-empty, from CLI)
Epoch = engine state Epoch (0 — no AssignmentObserved yet)
EV = engine state EndpointVersion (0 — same)
So the captured b.id = {v1, r1, 0, 0} — partially-zero, not
all-zero. SetIdentity's strict zero-check refused to update.
Subsequent lineageCheck saw proj.Epoch=1 vs b.id.Epoch=0 → still
ErrStalePrimary.
Fix: latch keys on Epoch (the meaningful "no authority line yet"
indicator). VolumeID/ReplicaID match is asserted as paranoia but
unchanged. Drift past a non-zero Epoch is still rejected (failover
safety net preserved via lineageCheck).
Plus 2 diagnostic INFO logs (per QA round-11 ask):
durable: dp.Open latching identity from projection volume=N
replica=N epoch=N ev=N (post-waitHealthy)
durable: StorageBackend.SetIdentity latched volume=N replica=N
epoch=N ev=N
Test renamed: LatchFromZero → LatchFromZeroEpoch. Now constructs
backend with the realistic pre-assignment shape ({v1, r1, 0, 0})
and verifies (a) latch transitions from Epoch=0, (b) drift past
non-zero Epoch is rejected, (c) Identity returns the latched
value.
Tests still green: durable, blockvolume (G5-4 integration), master,
authority, replication, replication/component.
Refs: QA round 11 — fix didn't take effect; my zero-check was
wrong about the pre-assignment Identity shape.
Languages
Go
84.5%
Rust
7.9%
Shell
2.7%
templ
1.6%
Java
1%
Other
2%