filer prefer volume server in same data center (#3405)
* initial prefer same data center https://github.com/seaweedfs/seaweedfs/issues/3404 * GetDataCenter * prefer same data center for ReplicationSource * GetDataCenterId * remove glog
This commit is contained in:
committed by
GitHub
parent
28a1f42962
commit
4d08393b7c
@@ -72,13 +72,17 @@ func (ms *MasterServer) findVolumeLocation(collection, vid string) operation.Loo
|
||||
} else {
|
||||
machines := ms.Topo.Lookup(collection, volumeId)
|
||||
for _, loc := range machines {
|
||||
locations = append(locations, operation.Location{Url: loc.Url(), PublicUrl: loc.PublicUrl})
|
||||
locations = append(locations, operation.Location{
|
||||
Url: loc.Url(), PublicUrl: loc.PublicUrl, DataCenter: loc.GetDataCenterId(),
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
machines, getVidLocationsErr := ms.MasterClient.GetVidLocations(vid)
|
||||
for _, loc := range machines {
|
||||
locations = append(locations, operation.Location{Url: loc.Url, PublicUrl: loc.PublicUrl})
|
||||
locations = append(locations, operation.Location{
|
||||
Url: loc.Url, PublicUrl: loc.PublicUrl, DataCenter: loc.DataCenter,
|
||||
})
|
||||
}
|
||||
err = getVidLocationsErr
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user