Browse Source
update metric for ErrorCRC if it happens during volume readNeedleDataInto (#5957)
pull/5960/head
Eugeniy E. Mikhailov
4 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
2 additions and
0 deletions
-
weed/storage/volume_read.go
|
@ -7,6 +7,7 @@ import ( |
|
|
"time" |
|
|
"time" |
|
|
|
|
|
|
|
|
"github.com/seaweedfs/seaweedfs/weed/glog" |
|
|
"github.com/seaweedfs/seaweedfs/weed/glog" |
|
|
|
|
|
"github.com/seaweedfs/seaweedfs/weed/stats" |
|
|
"github.com/seaweedfs/seaweedfs/weed/storage/backend" |
|
|
"github.com/seaweedfs/seaweedfs/weed/storage/backend" |
|
|
"github.com/seaweedfs/seaweedfs/weed/storage/needle" |
|
|
"github.com/seaweedfs/seaweedfs/weed/storage/needle" |
|
|
"github.com/seaweedfs/seaweedfs/weed/storage/super_block" |
|
|
"github.com/seaweedfs/seaweedfs/weed/storage/super_block" |
|
@ -180,6 +181,7 @@ func (v *Volume) readNeedleDataInto(n *needle.Needle, readOption *ReadOption, wr |
|
|
} |
|
|
} |
|
|
if offset == 0 && size == int64(n.DataSize) && (n.Checksum != crc && uint32(n.Checksum) != crc.Value()) { |
|
|
if offset == 0 && size == int64(n.DataSize) && (n.Checksum != crc && uint32(n.Checksum) != crc.Value()) { |
|
|
// the crc.Value() function is to be deprecated. this double checking is for backward compatible.
|
|
|
// the crc.Value() function is to be deprecated. this double checking is for backward compatible.
|
|
|
|
|
|
stats.VolumeServerHandlerCounter.WithLabelValues(stats.ErrorCRC).Inc() |
|
|
return fmt.Errorf("ReadNeedleData checksum %v expected %v", crc, n.Checksum) |
|
|
return fmt.Errorf("ReadNeedleData checksum %v expected %v", crc, n.Checksum) |
|
|
} |
|
|
} |
|
|
return nil |
|
|
return nil |
|
|