diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2022-02-07 09:58:26 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-07 09:58:26 -0800 |
| commit | 1b7fb3ce841617da442ac79881983a7a01bd3204 (patch) | |
| tree | 475453fcd12521f49e5fa3f17fd5c00a5e6e339e | |
| parent | 9405eaefdbd8ee94dac9bd12e324e81afaa474f5 (diff) | |
| parent | fb97e234c9f4c0f14c1075b775bd0db94b13af78 (diff) | |
| download | seaweedfs-1b7fb3ce841617da442ac79881983a7a01bd3204.tar.xz seaweedfs-1b7fb3ce841617da442ac79881983a7a01bd3204.zip | |
Merge pull request #2643 from kmlebedev/graceful_volume_stop
| -rw-r--r-- | weed/storage/store_vacuum.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/weed/storage/store_vacuum.go b/weed/storage/store_vacuum.go index 0d6e0b0f1..cbd716b32 100644 --- a/weed/storage/store_vacuum.go +++ b/weed/storage/store_vacuum.go @@ -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() } |
