aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2023-07-06 00:33:02 -0700
committerchrislu <chris.lu@gmail.com>2023-07-06 00:33:02 -0700
commitab30f489c39270e5e63c819fef4fce92da081f8c (patch)
tree290ad7db22e48c4596091dafb1eebb2f2fd85e53
parent31b2751affd24ccff4633d09b88311587b39289a (diff)
parent61553beba280d75f6676a57c2be41b57f519823c (diff)
downloadseaweedfs-ab30f489c39270e5e63c819fef4fce92da081f8c.tar.xz
seaweedfs-ab30f489c39270e5e63c819fef4fce92da081f8c.zip
Merge branch 'master' of https://github.com/seaweedfs/seaweedfs
-rw-r--r--weed/storage/store_vacuum.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/weed/storage/store_vacuum.go b/weed/storage/store_vacuum.go
index 26cd370a4..531d859b8 100644
--- a/weed/storage/store_vacuum.go
+++ b/weed/storage/store_vacuum.go
@@ -33,7 +33,10 @@ func (s *Store) CommitCompactVolume(vid needle.VolumeId) (bool, int64, error) {
if v := s.findVolume(vid); v != nil {
isReadOnly := v.IsReadOnly()
err := v.CommitCompact()
- volumeSize, _, _ := v.DataBackend.GetStat()
+ var volumeSize int64 = 0
+ if err == nil && v.DataBackend != nil {
+ volumeSize, _, _ = v.DataBackend.GetStat()
+ }
return isReadOnly, volumeSize, err
}
return false, 0, fmt.Errorf("volume id %d is not found during commit compact", vid)