aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-07-21 13:49:09 -0700
committerChris Lu <chris.lu@gmail.com>2019-07-21 13:49:09 -0700
commit4b15c8f0c4e3b9ccf2a5d20b891c1906a490c5e9 (patch)
treec79e4e73b64931301a791ea695a7093441df3849
parentfd16adbde184c11c3480dd79907ca6fbde71beeb (diff)
downloadseaweedfs-4b15c8f0c4e3b9ccf2a5d20b891c1906a490c5e9.tar.xz
seaweedfs-4b15c8f0c4e3b9ccf2a5d20b891c1906a490c5e9.zip
volume: lock writables changes
-rw-r--r--weed/topology/topology_vacuum.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/weed/topology/topology_vacuum.go b/weed/topology/topology_vacuum.go
index 351ff842f..438ca8de9 100644
--- a/weed/topology/topology_vacuum.go
+++ b/weed/topology/topology_vacuum.go
@@ -46,7 +46,10 @@ func batchVacuumVolumeCheck(grpcDialOption grpc.DialOption, vl *VolumeLayout, vi
return isCheckSuccess
}
func batchVacuumVolumeCompact(grpcDialOption grpc.DialOption, vl *VolumeLayout, vid needle.VolumeId, locationlist *VolumeLocationList, preallocate int64) bool {
+ vl.accessLock.Lock()
vl.removeFromWritable(vid)
+ vl.accessLock.Unlock()
+
ch := make(chan bool, locationlist.Length())
for index, dn := range locationlist.list {
go func(index int, url string, vid needle.VolumeId) {