aboutsummaryrefslogtreecommitdiff
path: root/weed/topology
diff options
context:
space:
mode:
authorKonstantin Lebedev <lebedev_k@tochka.com>2020-12-01 16:03:34 +0500
committerKonstantin Lebedev <lebedev_k@tochka.com>2020-12-01 16:03:34 +0500
commit03620776ece3175dac979b05c491d26d14faef0f (patch)
tree4fce7d0a55c3fa7f5b7c43e9d90d5e194c439239 /weed/topology
parent4e55baf5b109cfe5cf9f65c44cd92c542b4acf5e (diff)
parent005a6123e98170b2bdf99eb5b8a67ca3cea94190 (diff)
downloadseaweedfs-03620776ece3175dac979b05c491d26d14faef0f.tar.xz
seaweedfs-03620776ece3175dac979b05c491d26d14faef0f.zip
Merge branch 'upstream_master' into store_s3cred
Diffstat (limited to 'weed/topology')
-rw-r--r--weed/topology/topology.go4
-rw-r--r--weed/topology/topology_vacuum.go5
-rw-r--r--weed/topology/volume_layout.go1
3 files changed, 5 insertions, 5 deletions
diff --git a/weed/topology/topology.go b/weed/topology/topology.go
index e217617e9..bde72cf09 100644
--- a/weed/topology/topology.go
+++ b/weed/topology/topology.go
@@ -177,7 +177,9 @@ func (t *Topology) DeleteCollection(collectionName string) {
}
func (t *Topology) RegisterVolumeLayout(v storage.VolumeInfo, dn *DataNode) {
- t.GetVolumeLayout(v.Collection, v.ReplicaPlacement, v.Ttl).RegisterVolume(&v, dn)
+ vl := t.GetVolumeLayout(v.Collection, v.ReplicaPlacement, v.Ttl)
+ vl.RegisterVolume(&v, dn)
+ vl.EnsureCorrectWritables(&v)
}
func (t *Topology) UnRegisterVolumeLayout(v storage.VolumeInfo, dn *DataNode) {
glog.Infof("removing volume info:%+v", v)
diff --git a/weed/topology/topology_vacuum.go b/weed/topology/topology_vacuum.go
index 7bf55d131..04c26bc4d 100644
--- a/weed/topology/topology_vacuum.go
+++ b/weed/topology/topology_vacuum.go
@@ -144,12 +144,12 @@ func batchVacuumVolumeCleanup(grpcDialOption grpc.DialOption, vl *VolumeLayout,
}
}
-func (t *Topology) Vacuum(grpcDialOption grpc.DialOption, garbageThreshold float64, preallocate int64) int {
+func (t *Topology) Vacuum(grpcDialOption grpc.DialOption, garbageThreshold float64, preallocate int64) {
// if there is vacuum going on, return immediately
swapped := atomic.CompareAndSwapInt64(&t.vacuumLockCounter, 0, 1)
if !swapped {
- return 0
+ return
}
defer atomic.StoreInt64(&t.vacuumLockCounter, 0)
@@ -165,7 +165,6 @@ func (t *Topology) Vacuum(grpcDialOption grpc.DialOption, garbageThreshold float
}
}
}
- return 0
}
func vacuumOneVolumeLayout(grpcDialOption grpc.DialOption, volumeLayout *VolumeLayout, c *Collection, garbageThreshold float64, preallocate int64) {
diff --git a/weed/topology/volume_layout.go b/weed/topology/volume_layout.go
index 4c9c84459..0db95d289 100644
--- a/weed/topology/volume_layout.go
+++ b/weed/topology/volume_layout.go
@@ -141,7 +141,6 @@ func (vl *VolumeLayout) RegisterVolume(v *storage.VolumeInfo, dn *DataNode) {
vl.accessLock.Lock()
defer vl.accessLock.Unlock()
- defer vl.ensureCorrectWritables(v.Id)
defer vl.rememberOversizedVolume(v, dn)
if _, ok := vl.vid2location[v.Id]; !ok {