From 9da3ea35ac6724b83ef77e872bc41c68f9f86c2c Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 20 Mar 2013 05:12:55 -0700 Subject: [PATCH] avoid empty data nodes --- go/topology/topology.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)