aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/volume.go
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2022-04-26 23:29:22 -0700
committerGitHub <noreply@github.com>2022-04-26 23:29:22 -0700
commitffe028f8d097ccf579947478fd5d0785f2d08191 (patch)
treee64a34948a077a199d988c4588115cbf04c68d5f /weed/storage/volume.go
parent37ab8909b00c35fc8dce8eb7aba795bb7d8e438d (diff)
parent7315d1d0397a939742fb5d704a3bb95ece9d8d31 (diff)
downloadseaweedfs-ffe028f8d097ccf579947478fd5d0785f2d08191.tar.xz
seaweedfs-ffe028f8d097ccf579947478fd5d0785f2d08191.zip
Merge pull request #2974 from kmlebedev/wait_volume_closed_compression
waite volume being closed during compression idx
Diffstat (limited to 'weed/storage/volume.go')
-rw-r--r--weed/storage/volume.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/storage/volume.go b/weed/storage/volume.go
index b4791692e..bebeded54 100644
--- a/weed/storage/volume.go
+++ b/weed/storage/volume.go
@@ -211,6 +211,10 @@ func (v *Volume) Close() {
v.dataFileAccessLock.Lock()
defer v.dataFileAccessLock.Unlock()
if v.nm != nil {
+ for v.isCompacting {
+ glog.Warningf("Volume being closed during compression idx %d", v.Id)
+ time.Sleep(time.Second)
+ }
if err := v.nm.Sync(); err != nil {
glog.Warningf("Volume Close fail to sync volume idx %d", v.Id)
}