diff options
| author | coffeecloudgit <168399738+coffeecloudgit@users.noreply.github.com> | 2024-12-16 14:05:47 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-15 22:05:47 -0800 |
| commit | c531e2eb0e594ef35971ed3dcb4918d4447cabaf (patch) | |
| tree | 2fd109e2c3d94a56563386f85e180ae8cb1472b7 | |
| parent | 7eb8257126576921ff328059d4e5c503f9d53cf7 (diff) | |
| download | seaweedfs-c531e2eb0e594ef35971ed3dcb4918d4447cabaf.tar.xz seaweedfs-c531e2eb0e594ef35971ed3dcb4918d4447cabaf.zip | |
Update disk_location_ec.go (#6359)
Add lock for l.ecVolumes
| -rw-r--r-- | weed/storage/disk_location_ec.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/storage/disk_location_ec.go b/weed/storage/disk_location_ec.go index bb5738897..ac8d52fb7 100644 --- a/weed/storage/disk_location_ec.go +++ b/weed/storage/disk_location_ec.go @@ -195,6 +195,10 @@ func (l *DiskLocation) loadAllEcShards() (err error) { } func (l *DiskLocation) deleteEcVolumeById(vid needle.VolumeId) (e error) { + // Add write lock since we're modifying the ecVolumes map + l.ecVolumesLock.Lock() + defer l.ecVolumesLock.Unlock() + ecVolume, ok := l.ecVolumes[vid] if !ok { return |
