aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/volume.go
diff options
context:
space:
mode:
authorKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2022-10-13 12:51:20 +0500
committerGitHub <noreply@github.com>2022-10-13 00:51:20 -0700
commit1f7e52c63e210ccb3a177c1e58d5a0c8e79ad870 (patch)
tree42b417fc124d40d01f75eb3d5eb9e6bce86b2e5f /weed/storage/volume.go
parentf5d4952d7306ba013bb9c054b221d795a3e110d6 (diff)
downloadseaweedfs-1f7e52c63e210ccb3a177c1e58d5a0c8e79ad870.tar.xz
seaweedfs-1f7e52c63e210ccb3a177c1e58d5a0c8e79ad870.zip
vacuum metrics and force sync dst files (#3832)
Diffstat (limited to 'weed/storage/volume.go')
-rw-r--r--weed/storage/volume.go18
1 files changed, 1 insertions, 17 deletions
diff --git a/weed/storage/volume.go b/weed/storage/volume.go
index 1a9c8bd24..ab8af91e2 100644
--- a/weed/storage/volume.go
+++ b/weed/storage/volume.go
@@ -180,21 +180,6 @@ func (v *Volume) DiskType() types.DiskType {
return v.location.DiskType
}
-func (v *Volume) SetStopping() {
- v.dataFileAccessLock.Lock()
- defer v.dataFileAccessLock.Unlock()
- if v.nm != nil {
- if err := v.nm.Sync(); err != nil {
- glog.Warningf("Volume SetStopping fail to sync volume idx %d", v.Id)
- }
- }
- if v.DataBackend != nil {
- if err := v.DataBackend.Sync(); err != nil {
- glog.Warningf("Volume SetStopping fail to sync volume %d", v.Id)
- }
- }
-}
-
func (v *Volume) SyncToDisk() {
v.dataFileAccessLock.Lock()
defer v.dataFileAccessLock.Unlock()
@@ -228,10 +213,9 @@ func (v *Volume) Close() {
v.nm = nil
}
if v.DataBackend != nil {
- if err := v.DataBackend.Sync(); err != nil {
+ if err := v.DataBackend.Close(); err != nil {
glog.Warningf("Volume Close fail to sync volume %d", v.Id)
}
- _ = v.DataBackend.Close()
v.DataBackend = nil
stats.VolumeServerVolumeCounter.WithLabelValues(v.Collection, "volume").Dec()
}