mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
error logging
This commit is contained in:
parent
48b23f2fdd
commit
212b6e7d42
|
@ -114,7 +114,7 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, err error) {
|
|||
|
||||
func (c *ChunkReadAt) fetchChunkData(chunkView *ChunkView) (data []byte, err error) {
|
||||
|
||||
// fmt.Printf("fetching %s [%d,%d)\n", chunkView.FileId, chunkView.LogicOffset, chunkView.LogicOffset+int64(chunkView.Size))
|
||||
glog.V(4).Infof("fetchChunkData %s [%d,%d)\n", chunkView.FileId, chunkView.LogicOffset, chunkView.LogicOffset+int64(chunkView.Size))
|
||||
|
||||
hasDataInCache := false
|
||||
chunkData := c.chunkCache.GetChunk(chunkView.FileId, chunkView.ChunkSize)
|
||||
|
|
|
@ -76,6 +76,8 @@ func (c *ChunkCache) SetChunk(fileId string, data []byte) {
|
|||
c.Lock()
|
||||
defer c.Unlock()
|
||||
|
||||
glog.V(4).Infof("SetChunk %s size %d\n", fileId, len(data))
|
||||
|
||||
c.doSetChunk(fileId, data)
|
||||
}
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ func (v *ChunkCacheVolume) WriteNeedle(key types.NeedleId, data []byte) error {
|
|||
}
|
||||
|
||||
if err := v.nm.Put(key, types.ToOffset(offset), uint32(len(data))); err != nil {
|
||||
glog.V(4).Infof("failed to save in needle map %d: %v", key, err)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
@ -54,7 +54,9 @@ func (c *OnDiskCacheLayer) setChunk(needleId types.NeedleId, data []byte) {
|
|||
c.diskCaches[0] = t
|
||||
}
|
||||
|
||||
c.diskCaches[0].WriteNeedle(needleId, data)
|
||||
if err := c.diskCaches[0].WriteNeedle(needleId, data); err != nil {
|
||||
glog.V(0).Infof("cache write %v size %d: %v", needleId, len(data), err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue