mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-20 07:02:09 +08:00
Fix update of SeaweedFS_volumeServer_volumes
gauge metrics when EC shards are unmounted (#6776)
Some checks failed
go: build dev binaries / cleanup (push) Has been cancelled
docker: build dev containers / build-dev-containers (push) Has been cancelled
End to End / FUSE Mount (push) Has been cancelled
go: build binary / Build (push) Has been cancelled
Ceph S3 tests / Ceph S3 tests (push) Has been cancelled
test s3 over https using aws-cli / awscli-tests (push) Has been cancelled
go: build dev binaries / build_dev_linux_windows (amd64, linux) (push) Has been cancelled
go: build dev binaries / build_dev_linux_windows (amd64, windows) (push) Has been cancelled
go: build dev binaries / build_dev_darwin (amd64, darwin) (push) Has been cancelled
go: build dev binaries / build_dev_darwin (arm64, darwin) (push) Has been cancelled
Some checks failed
go: build dev binaries / cleanup (push) Has been cancelled
docker: build dev containers / build-dev-containers (push) Has been cancelled
End to End / FUSE Mount (push) Has been cancelled
go: build binary / Build (push) Has been cancelled
Ceph S3 tests / Ceph S3 tests (push) Has been cancelled
test s3 over https using aws-cli / awscli-tests (push) Has been cancelled
go: build dev binaries / build_dev_linux_windows (amd64, linux) (push) Has been cancelled
go: build dev binaries / build_dev_linux_windows (amd64, windows) (push) Has been cancelled
go: build dev binaries / build_dev_darwin (amd64, darwin) (push) Has been cancelled
go: build dev binaries / build_dev_darwin (arm64, darwin) (push) Has been cancelled
This commit is contained in:
parent
d8cc269294
commit
dddb0f0ae5
@ -45,11 +45,19 @@ func NewEcVolumeShard(diskType types.DiskType, dirname string, collection string
|
||||
}
|
||||
v.ecdFileSize = ecdFi.Size()
|
||||
|
||||
stats.VolumeServerVolumeGauge.WithLabelValues(v.Collection, "ec_shards").Inc()
|
||||
v.Mount()
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (shard *EcVolumeShard) Mount() {
|
||||
stats.VolumeServerVolumeGauge.WithLabelValues(shard.Collection, "ec_shards").Inc()
|
||||
}
|
||||
|
||||
func (shard *EcVolumeShard) Unmount() {
|
||||
stats.VolumeServerVolumeGauge.WithLabelValues(shard.Collection, "ec_shards").Dec()
|
||||
}
|
||||
|
||||
func (shard *EcVolumeShard) Size() int64 {
|
||||
return shard.ecdFileSize
|
||||
}
|
||||
@ -88,8 +96,8 @@ func (shard *EcVolumeShard) Close() {
|
||||
}
|
||||
|
||||
func (shard *EcVolumeShard) Destroy() {
|
||||
shard.Unmount()
|
||||
os.Remove(shard.FileName() + ToExt(int(shard.ShardId)))
|
||||
stats.VolumeServerVolumeGauge.WithLabelValues(shard.Collection, "ec_shards").Dec()
|
||||
}
|
||||
|
||||
func (shard *EcVolumeShard) ReadAt(buf []byte, offset int64) (int, error) {
|
||||
|
@ -111,7 +111,7 @@ func (ev *EcVolume) DeleteEcVolumeShard(shardId ShardId) (ecVolumeShard *EcVolum
|
||||
}
|
||||
|
||||
ecVolumeShard = ev.Shards[foundPosition]
|
||||
|
||||
ecVolumeShard.Unmount()
|
||||
ev.Shards = append(ev.Shards[:foundPosition], ev.Shards[foundPosition+1:]...)
|
||||
return ecVolumeShard, true
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user