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
volume: proxy writes to remote volume server, with replication or not
Chris Lu7edbee6f57f9
diff --git a/weed/topology/store_replicate.go b/weed/topology/store_replicate.goindex c7738311cc..495c38cfa3 100644--- a/weed/topology/store_replicate.go+++ b/weed/topology/store_replicate.go@@ -154,27 +154,32 @@ func distributedOperation(locations []operation.Location, store *storage.Store,func getWritableRemoteReplications(s *storage.Store, volumeId needle.VolumeId, masterNode string) (remoteLocations []operation.Location, err error) {+v := s.GetVolume(volumeId)- if v == nil {- return nil, fmt.Errorf("fail to find volume %d", volumeId)+ if v != nil && v.ReplicaPlacement.GetCopyCount() == 1 {+ return}- copyCount := v.ReplicaPlacement.GetCopyCount()- if copyCount > 1 {- if lookupResult, lookupErr := operation.Lookup(masterNode, volumeId.String()); lookupErr == nil {- if len(lookupResult.Locations) < copyCount {- err = fmt.Errorf("replicating opetations [%d] is less than volume %d replication copy count [%d]",- len(lookupResult.Locations), volumeId, copyCount)- return- }- selfUrl := s.Ip + ":" + strconv.Itoa(s.Port)- for _, location := range lookupResult.Locations {- if location.Url != selfUrl {- remoteLocations = append(remoteLocations, location)- }++ // not on local store, or has replications+ lookupResult, lookupErr := operation.Lookup(masterNode, volumeId.String())+ if lookupErr == nil {+ selfUrl := s.Ip + ":" + strconv.Itoa(s.Port)+ for _, location := range lookupResult.Locations {+ if location.Url != selfUrl {+ remoteLocations = append(remoteLocations, location)}- } else {- err = fmt.Errorf("failed to lookup for %d: %v", volumeId, lookupErr)- return+ }+ } else {+ err = fmt.Errorf("failed to lookup for %d: %v", volumeId, lookupErr)+ return+ }++ if v != nil {+ // has one local and has remote replications+ copyCount := v.ReplicaPlacement.GetCopyCount()+ if len(lookupResult.Locations) < copyCount {+ err = fmt.Errorf("replicating opetations [%d] is less than volume %d replication copy count [%d]",+ len(lookupResult.Locations), volumeId, copyCount)}}