diff options
| author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2024-09-01 23:30:09 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-01 20:30:09 -0700 |
| commit | 220061573d3fd771d62aecbc0dc5b0833f0cc602 (patch) | |
| tree | e31c4fcffd36275650521251e0d3440a061f923c | |
| parent | 3c0854e98670b97e601b55b08d9d25327bc5b81f (diff) | |
| download | seaweedfs-220061573d3fd771d62aecbc0dc5b0833f0cc602.tar.xz seaweedfs-220061573d3fd771d62aecbc0dc5b0833f0cc602.zip | |
update metric for ErrorCRC if it happens during volume readNeedleDataInto (#5957)
| -rw-r--r-- | weed/storage/volume_read.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/weed/storage/volume_read.go b/weed/storage/volume_read.go index 09fbdd701..34b75660e 100644 --- a/weed/storage/volume_read.go +++ b/weed/storage/volume_read.go @@ -7,6 +7,7 @@ import ( "time" "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/needle" "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()) { // 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 nil |
