diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-10-18 20:34:43 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-10-18 20:34:43 -0700 |
| commit | 201c24c110591aca60372f35f663bd42cd00c083 (patch) | |
| tree | d7c92da106f2e3335ab1fd177e53f83a4e726ff3 /weed/topology/topology_event_handling.go | |
| parent | 46eb77f9bb629610fe90b8b9eb4d9fed2e6dda04 (diff) | |
| download | seaweedfs-201c24c110591aca60372f35f663bd42cd00c083.tar.xz seaweedfs-201c24c110591aca60372f35f663bd42cd00c083.zip | |
add locking to volume layout vacuum
Diffstat (limited to 'weed/topology/topology_event_handling.go')
| -rw-r--r-- | weed/topology/topology_event_handling.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/topology/topology_event_handling.go b/weed/topology/topology_event_handling.go index 4d9d4cbe5..a301103eb 100644 --- a/weed/topology/topology_event_handling.go +++ b/weed/topology/topology_event_handling.go @@ -40,6 +40,10 @@ func (t *Topology) SetVolumeCapacityFull(volumeInfo storage.VolumeInfo) bool { if !vl.SetVolumeCapacityFull(volumeInfo.Id) { return false } + + vl.accessLock.RLock() + defer vl.accessLock.RUnlock() + for _, dn := range vl.vid2location[volumeInfo.Id].list { if !volumeInfo.ReadOnly { dn.UpAdjustActiveVolumeCountDelta(-1) |
