waite volume being closed during compression idx

This commit is contained in:
Konstantin Lebedev 2022-04-26 13:40:42 +05:00
parent 3bce568c32
commit 7315d1d039

View file

@ -195,6 +195,10 @@ func (v *Volume) Close() {
v.dataFileAccessLock.Lock() v.dataFileAccessLock.Lock()
defer v.dataFileAccessLock.Unlock() defer v.dataFileAccessLock.Unlock()
if v.nm != nil { 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 { if err := v.nm.Sync(); err != nil {
glog.Warningf("Volume Close fail to sync volume idx %d", v.Id) glog.Warningf("Volume Close fail to sync volume idx %d", v.Id)
} }