SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
test: poll for TopologyId convergence in multi-master failover tests
Chris Lu10ce19cb17b6
diff --git a/test/multi_master/failover_test.go b/test/multi_master/failover_test.goindex 9b491c89cc..acace3396e 100644--- a/test/multi_master/failover_test.go+++ b/test/multi_master/failover_test.go@@ -290,9 +290,31 @@ func TestLeaderConsistencyAcrossNodes(t *testing.T) {assertTopologyIdConsistent(t, mc, topologyId)}-// assertTopologyIdConsistent verifies that all running nodes report the expected TopologyId.+// assertTopologyIdConsistent waits until all running nodes report the expected+// TopologyId. A restarted node only discovers it after the leader has admitted+// it back into raft — /dir/status is proxied to the leader, so a node that has+// not yet learned the leader reports its own empty id. That admission trails+// HTTP readiness by several seconds, so a one-shot check races the propagation.func assertTopologyIdConsistent(t *testing.T, mc *MasterCluster, expectedId string) {t.Helper()+ deadline := time.Now().Add(waitTimeout)+ for time.Now().Before(deadline) {+ consistent := true+ for i := range 3 {+ if !mc.IsNodeRunning(i) {+ continue+ }+ if id, err := mc.GetTopologyId(i); err != nil || id != expectedId {+ consistent = false+ break+ }+ }+ if consistent {+ return+ }+ time.Sleep(waitTick)+ }+ // Timed out: report what each node actually sees.for i := range 3 {if !mc.IsNodeRunning(i) {continue