Files
seaweedfs/weed/storage
Chris LuandGitHub 4dc1b70b2f test: pin that a .vif replication outranks the superblock (#10499)
* test: pin that a .vif replication outranks the superblock

Store.ConfigureVolume rewrites the .vif and never the replica-placement byte in
the .dat, so that byte keeps whatever the volume was created with for good.
readSuperBlock reads it and then overrides it from the .vif, which is what makes
a replication change take effect and survive a remount.

Invert that and every replication change silently reverts on the next mount,
while the .vif on disk still records what the operator asked for -- a durability
setting quietly going back to its old value, with nothing to indicate it.

Worth pinning rather than reading off the code, because the field beside it
resolves the other way: version takes the superblock over the .vif. Two fields,
one function, opposite precedence, each a line to invert wrongly.

Covers the empty case too, since a .vif that declares no replication has to
leave the superblock standing or a volume whose replication was never
configured would be forced to whatever the zero value parses as.

* test: drop the unreachable nil check on MaybeLoadVolumeInfo

It initialises the returned pointer before the existence check and every
return is naked, so it never yields nil. Guarding against it implied a
contract the callee does not have.
2026-07-30 17:03:38 -07:00
..
2025-06-30 13:57:28 -07:00
2025-06-16 22:05:06 -07:00