From 7315d1d0397a939742fb5d704a3bb95ece9d8d31 Mon Sep 17 00:00:00 2001 From: Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> Date: Tue, 26 Apr 2022 13:40:42 +0500 Subject: [PATCH] waite volume being closed during compression idx --- weed/storage/volume.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/weed/storage/volume.go b/weed/storage/volume.go index 6d48fbc83..2dfba55c8 100644 --- a/weed/storage/volume.go +++ b/weed/storage/volume.go @@ -195,6 +195,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) }