diff options
| author | Chris Lu <chris.lu@gmail.com> | 2013-03-20 05:12:55 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2013-03-20 05:12:55 -0700 |
| commit | 9da3ea35ac6724b83ef77e872bc41c68f9f86c2c (patch) | |
| tree | 8fa7ee63df19f58a3d4eccc3cb1be66f4e05c387 /go/topology | |
| parent | 0c75e0438ea83c3162b7b3f7ffb609f92053b623 (diff) | |
| download | seaweedfs-9da3ea35ac6724b83ef77e872bc41c68f9f86c2c.tar.xz seaweedfs-9da3ea35ac6724b83ef77e872bc41c68f9f86c2c.zip | |
avoid empty data nodes
Diffstat (limited to 'go/topology')
| -rw-r--r-- | go/topology/topology.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/go/topology/topology.go b/go/topology/topology.go index 1c55138e2..8c8a2223f 100644 --- a/go/topology/topology.go +++ b/go/topology/topology.go @@ -105,7 +105,7 @@ func (t *Topology) PickForWrite(repType storage.ReplicationType, count int) (str t.replicaType2VolumeLayout[replicationTypeIndex] = NewVolumeLayout(repType, t.volumeSizeLimit, t.pulse) } 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!") } fileId, count := t.sequence.NextFileId(count) |
