Browse Source

error logging

pull/1377/head
Chris Lu 5 years ago
parent
commit
212b6e7d42
  1. 2
      weed/filer2/reader_at.go
  2. 2
      weed/util/chunk_cache/chunk_cache.go
  3. 2
      weed/util/chunk_cache/chunk_cache_on_disk.go
  4. 4
      weed/util/chunk_cache/on_disk_cache_layer.go

2
weed/filer2/reader_at.go

@ -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)

2
weed/util/chunk_cache/chunk_cache.go

@ -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)
}

2
weed/util/chunk_cache/chunk_cache_on_disk.go

@ -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

4
weed/util/chunk_cache/on_disk_cache_layer.go

@ -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…
Cancel
Save