mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-12-17 09:42:29 +08:00
add other replica locations when assigning volumes
This commit is contained in:
@@ -150,12 +150,20 @@ func (ms *MasterServer) Assign(ctx context.Context, req *master_pb.AssignRequest
|
||||
fid, count, dnList, err := ms.Topo.PickForWrite(req.Count, option)
|
||||
if err == nil {
|
||||
dn := dnList.Head()
|
||||
var replicas []*master_pb.AssignResponse_Replica
|
||||
for _, r := range dnList.Rest() {
|
||||
replicas = append(replicas, &master_pb.AssignResponse_Replica{
|
||||
Url: r.Url(),
|
||||
PublicUrl: r.PublicUrl,
|
||||
})
|
||||
}
|
||||
return &master_pb.AssignResponse{
|
||||
Fid: fid,
|
||||
Url: dn.Url(),
|
||||
PublicUrl: dn.PublicUrl,
|
||||
Count: count,
|
||||
Auth: string(security.GenJwt(ms.guard.SigningKey, ms.guard.ExpiresAfterSec, fid)),
|
||||
Replicas: replicas,
|
||||
}, nil
|
||||
}
|
||||
//glog.V(4).Infoln("waiting for volume growing...")
|
||||
|
||||
Reference in New Issue
Block a user