aboutsummaryrefslogtreecommitdiff
path: root/weed/topology/topology.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-02-25 00:34:25 -0800
committerChris Lu <chris.lu@gmail.com>2019-02-25 00:34:25 -0800
commitc892b898a1950b0faf8a8c6409a45b627b81685b (patch)
tree6f0b1cb1ebdbb1ef0121a2f140f4d4eb1095d64d /weed/topology/topology.go
parent0d84e32f56876b4ea99ed2aa767347c125bde428 (diff)
parent47bf0e3eaeb2ba2c46f4540a18b7382c7cf51ff1 (diff)
downloadseaweedfs-c892b898a1950b0faf8a8c6409a45b627b81685b.tar.xz
seaweedfs-c892b898a1950b0faf8a8c6409a45b627b81685b.zip
Merge branch 'master' of https://github.com/chrislusf/seaweedfs
Diffstat (limited to 'weed/topology/topology.go')
-rw-r--r--weed/topology/topology.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/weed/topology/topology.go b/weed/topology/topology.go
index 619cc9696..77716605a 100644
--- a/weed/topology/topology.go
+++ b/weed/topology/topology.go
@@ -88,11 +88,13 @@ func (t *Topology) Lookup(collection string, vid storage.VolumeId) []*DataNode {
return nil
}
-func (t *Topology) NextVolumeId() storage.VolumeId {
+func (t *Topology) NextVolumeId() (storage.VolumeId, error) {
vid := t.GetMaxVolumeId()
next := vid.Next()
- go t.RaftServer.Do(NewMaxVolumeIdCommand(next))
- return next
+ if _, err := t.RaftServer.Do(NewMaxVolumeIdCommand(next)); err != nil {
+ return 0, err
+ }
+ return next, nil
}
func (t *Topology) HasWritableVolume(option *VolumeGrowOption) bool {