mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
avoid empty data nodes
This commit is contained in:
parent
0c75e0438e
commit
9da3ea35ac
|
@ -105,7 +105,7 @@ func (t *Topology) PickForWrite(repType storage.ReplicationType, count int) (str
|
||||||
t.replicaType2VolumeLayout[replicationTypeIndex] = NewVolumeLayout(repType, t.volumeSizeLimit, t.pulse)
|
t.replicaType2VolumeLayout[replicationTypeIndex] = NewVolumeLayout(repType, t.volumeSizeLimit, t.pulse)
|
||||||
}
|
}
|
||||||
vid, count, datanodes, err := t.replicaType2VolumeLayout[replicationTypeIndex].PickForWrite(count)
|
vid, count, datanodes, err := t.replicaType2VolumeLayout[replicationTypeIndex].PickForWrite(count)
|
||||||
if err != nil {
|
if err != nil || datanodes.Length() == 0 {
|
||||||
return "", 0, nil, errors.New("No writable volumes avalable!")
|
return "", 0, nil, errors.New("No writable volumes avalable!")
|
||||||
}
|
}
|
||||||
fileId, count := t.sequence.NextFileId(count)
|
fileId, count := t.sequence.NextFileId(count)
|
||||||
|
|
Loading…
Reference in a new issue