mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
skips compact if store is stopping
This commit is contained in:
parent
433fde4b18
commit
fb97e234c9
|
@ -26,6 +26,9 @@ func (s *Store) CompactVolume(vid needle.VolumeId, preallocate int64, compaction
|
|||
return fmt.Errorf("volume id %d is not found during compact", vid)
|
||||
}
|
||||
func (s *Store) CommitCompactVolume(vid needle.VolumeId) (bool, error) {
|
||||
if s.isStopping {
|
||||
return false, fmt.Errorf("volume id %d skips compact because volume is stopping", vid)
|
||||
}
|
||||
if v := s.findVolume(vid); v != nil {
|
||||
return v.IsReadOnly(), v.CommitCompact()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue