mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
adjust logging
This commit is contained in:
parent
cbffbd9025
commit
50d9383c3b
|
@ -161,7 +161,7 @@ func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, error) {
|
|||
glog.Errorf("file handle read %s: %v", fileFullPath, err)
|
||||
}
|
||||
|
||||
// glog.V(4).Infof("file handle read %s [%d,%d] %d : %v", fileFullPath, offset, offset+int64(totalRead), totalRead, err)
|
||||
glog.V(4).Infof("file handle read %s [%d,%d] %d : %v", fileFullPath, offset, offset+int64(totalRead), totalRead, err)
|
||||
|
||||
return int64(totalRead), err
|
||||
}
|
||||
|
|
|
@ -70,24 +70,25 @@ func (pw *PageWriter) FlushData() error {
|
|||
func (pw *PageWriter) ReadDirtyDataAt(data []byte, offset int64) (maxStop int64) {
|
||||
glog.V(4).Infof("ReadDirtyDataAt %v [%d, %d)", pw.f.fullpath(), offset, offset+int64(len(data)))
|
||||
|
||||
dataSlice := data
|
||||
originalData := data
|
||||
originalOffset := offset
|
||||
|
||||
chunkIndex := offset / pw.chunkSize
|
||||
for i := chunkIndex; len(dataSlice) > 0; i++ {
|
||||
readSize := min(int64(len(dataSlice)), (i+1)*pw.chunkSize-offset)
|
||||
for i := chunkIndex; len(data) > 0; i++ {
|
||||
readSize := min(int64(len(data)), (i+1)*pw.chunkSize-offset)
|
||||
|
||||
if pw.streamWriter != nil {
|
||||
m1 := pw.streamWriter.ReadDirtyDataAt(dataSlice[:readSize], offset)
|
||||
m1 := pw.streamWriter.ReadDirtyDataAt(data[:readSize], offset)
|
||||
maxStop = max(maxStop, m1)
|
||||
}
|
||||
m2 := pw.randomWriter.ReadDirtyDataAt(dataSlice[:readSize], offset)
|
||||
m2 := pw.randomWriter.ReadDirtyDataAt(data[:readSize], offset)
|
||||
maxStop = max(maxStop, m2)
|
||||
|
||||
offset += readSize
|
||||
dataSlice = dataSlice[readSize:]
|
||||
data = data[readSize:]
|
||||
}
|
||||
|
||||
page_writer.CheckByteZero(fmt.Sprintf("page writer read [%d,%d)", offset, offset+int64(len(data))), data, 0, maxStop-offset)
|
||||
page_writer.CheckByteZero(fmt.Sprintf("page writer read [%d,%d)", originalOffset, originalOffset+int64(len(data))), originalData, 0, maxStop-originalOffset)
|
||||
|
||||
return
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ func CheckByteZero(message string, p []byte, start, stop int64) {
|
|||
break
|
||||
}
|
||||
}
|
||||
if isAllZero {
|
||||
if isAllZero && start != stop {
|
||||
glog.Errorf("%s is all zeros [%d,%d)", message, start, stop)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue