From 4b15c8f0c4e3b9ccf2a5d20b891c1906a490c5e9 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 21 Jul 2019 13:49:09 -0700 Subject: [PATCH] volume: lock writables changes --- weed/topology/topology_vacuum.go | 3 +++ 1 file changed, 3 insertions(+) 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) {