aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/volume.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-11-28 00:09:29 -0800
committerChris Lu <chris.lu@gmail.com>2020-11-28 00:09:29 -0800
commit2c913dde047a7b86925535ed47a7e4d741e4351d (patch)
tree3353fdea6d894b177fa2f09c166b46f899b158e4 /weed/storage/volume.go
parent9ac4935f22a2e871d8933cf36ddc2cb2f85625a7 (diff)
downloadseaweedfs-2c913dde047a7b86925535ed47a7e4d741e4351d.tar.xz
seaweedfs-2c913dde047a7b86925535ed47a7e4d741e4351d.zip
volume: detect and drop volumes with disk IO error
from Jethro in slack: is it possible to make the assign request a bit smarter? Currently I’m in the state that a disk failed but all assign request are being send to this volume. It would be cool if the master sees this and stopped using this volume. e=HTTP(http://x:8089/913,045a782b63176edf) not 200 but 500 Internal Server Error Body={"size":740167,"error":"failed to write to local disk: write /mnt/v9/913.dat: input/output error","eTag":"ee4381e202212ff3aee647704c036689"} e=HTTP(http://x:8089/913,045a782c90240077) not 200 but 500 Internal Server Error Body={"size":792779,"error":"failed to write to local disk: write /mnt/v9/913.dat: input/output error","eTag":"c43463ccc11eb6eb2fc306f407a6a953"} e=HTTP(http://x:8089/913,045a782e6b7901ea) not 200 but 500 Internal Server Error Body={"size":3962392,"error":"failed to write to local disk: write /mnt/v9/913.dat: input/output error","eTag":"04c91198e9b276c81f11dbf189af5d28"}
Diffstat (limited to 'weed/storage/volume.go')
-rw-r--r--weed/storage/volume.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/weed/storage/volume.go b/weed/storage/volume.go
index a03846d3d..c726e7f11 100644
--- a/weed/storage/volume.go
+++ b/weed/storage/volume.go
@@ -46,6 +46,8 @@ type Volume struct {
volumeInfo *volume_server_pb.VolumeInfo
location *DiskLocation
+
+ lastIoError error
}
func NewVolume(dirname string, dirIdx string, collection string, id needle.VolumeId, needleMapKind NeedleMapType, replicaPlacement *super_block.ReplicaPlacement, ttl *needle.TTL, preallocate int64, memoryMapMaxSizeMb uint32) (v *Volume, e error) {
@@ -86,10 +88,10 @@ func (v *Volume) IndexFileName() (fileName string) {
func (v *Volume) FileName(ext string) (fileName string) {
switch ext {
case ".idx", ".cpx", ".ldb":
- return VolumeFileName(v.dirIdx, v.Collection, int(v.Id))+ext
+ return VolumeFileName(v.dirIdx, v.Collection, int(v.Id)) + ext
}
// .dat, .cpd, .vif
- return VolumeFileName(v.dir, v.Collection, int(v.Id))+ext
+ return VolumeFileName(v.dir, v.Collection, int(v.Id)) + ext
}
func (v *Volume) Version() needle.Version {