From 0c898df43029bce934562630c2b66ac9d423e41c Mon Sep 17 00:00:00 2001 From: brstgt Date: Fri, 20 Jan 2017 11:52:23 +0100 Subject: [PATCH] Log volumeId if dataFileSize != actual data file size --- weed/storage/volume_read_write.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/weed/storage/volume_read_write.go b/weed/storage/volume_read_write.go index 66f18557f..8964f10cf 100644 --- a/weed/storage/volume_read_write.go +++ b/weed/storage/volume_read_write.go @@ -61,7 +61,7 @@ func (v *Volume) AppendBlob(b []byte) (offset int64, err error) { glog.V(0).Infof("failed to seek the end of file: %v", err) return } else if offset != int64(v.dataFileSize) { - glog.V(0).Infof("dataFileSize %d != actual data file size: %d", v.dataFileSize, offset) + glog.V(0).Infof("dataFileSize %d != actual data file size: %d, volumeId: %s", v.dataFileSize, offset, v.Id.String()) } //ensure file writing starting from aligned positions if offset%NeedlePaddingSize != 0 { @@ -70,7 +70,7 @@ func (v *Volume) AppendBlob(b []byte) (offset int64, err error) { glog.V(0).Infof("failed to align in datafile %s: %v", v.dataFile.Name(), err) return } else if offset != int64(v.dataFileSize) { - glog.V(0).Infof("dataFileSize %d != actual data file size: %d", v.dataFileSize, offset) + glog.V(0).Infof("dataFileSize %d != actual data file size: %d, volumeId: %s", v.dataFileSize, offset, v.Id.String()) } } _, err = v.dataFile.Write(b) @@ -96,7 +96,7 @@ func (v *Volume) writeNeedle(n *Needle) (size uint32, err error) { glog.V(0).Infof("failed to seek the end of file: %v", err) return } else if offset != int64(v.dataFileSize) { - glog.V(0).Infof("dataFileSize %d != actual data file size: %d", v.dataFileSize, offset) + glog.V(0).Infof("dataFileSize %d != actual data file size: %d, volumeId: %s", v.dataFileSize, offset, v.Id.String()) } //ensure file writing starting from aligned positions @@ -146,7 +146,7 @@ func (v *Volume) deleteNeedle(n *Needle) (uint32, error) { if offset, err := v.dataFile.Seek(0, 2); err != nil { return size, err } else if offset != int64(v.dataFileSize) { - glog.V(0).Infof("dataFileSize %d != actual data file size: %d, deleteMarker: %d", v.dataFileSize, offset, getActualSize(0)) + glog.V(0).Infof("dataFileSize %d != actual data file size: %d, deleteMarker: %d, volumeId: %s", v.dataFileSize, offset, getActualSize(0), v.Id.String()) } n.Data = nil _, actualSize, err := n.Append(v.dataFile, v.Version())