mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Merge pull request #2974 from kmlebedev/wait_volume_closed_compression
waite volume being closed during compression idx
This commit is contained in:
commit
ffe028f8d0
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue