0
0
Fork 0

unblock the files for clean up, esp for merged new segment files

This commit is contained in:
Sreekanth Sivasankaran 2018-02-02 14:44:02 +05:30
parent ff210fbc6d
commit 678c412157
1 changed files with 7 additions and 3 deletions

View File

@ -266,9 +266,7 @@ func (s *Scorch) persistSnapshot(snapshot *IndexSnapshot) error {
for k, v := range s.root.internal {
newIndexSnapshot.internal[k] = v
}
for _, filename := range filenames {
delete(s.ineligibleForRemoval, filename)
}
rootPrev := s.root
s.root = newIndexSnapshot
s.rootLock.Unlock()
@ -276,6 +274,12 @@ func (s *Scorch) persistSnapshot(snapshot *IndexSnapshot) error {
_ = rootPrev.DecRef()
}
}
// unlock the files for clean up
s.rootLock.Lock()
for _, filename := range filenames {
delete(s.ineligibleForRemoval, filename)
}
s.rootLock.Unlock()
return nil
}