aboutsummaryrefslogtreecommitdiff
path: root/weed/topology/topology.go
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2019-02-25 00:13:29 -0800
committerGitHub <noreply@github.com>2019-02-25 00:13:29 -0800
commit47bf0e3eaeb2ba2c46f4540a18b7382c7cf51ff1 (patch)
tree94cb3d2d08d38b7cfdc5445ab33142a8e1cb5602 /weed/topology/topology.go
parent0a106c1757c207d17e41f47b381a69eaab9ee1e6 (diff)
parent0bc3cdd26ae96de640b8b06896dff2baf7605abf (diff)
downloadseaweedfs-47bf0e3eaeb2ba2c46f4540a18b7382c7cf51ff1.tar.xz
seaweedfs-47bf0e3eaeb2ba2c46f4540a18b7382c7cf51ff1.zip
Merge pull request #858 from PapaYofen/hack
Fix https://github.com/chrislusf/seaweedfs/issues/825
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 {