Browse Source

adjust log level

pull/680/head
Chris Lu 7 years ago
parent
commit
defcd4edc5
  1. 4
      weed/storage/volume_vacuum.go
  2. 4
      weed/storage/volume_vacuum_test.go

4
weed/storage/volume_vacuum.go

@ -133,7 +133,7 @@ func (v *Volume) makeupDiff(newDatFileName, newIdxFileName, oldDatFileName, oldI
return fmt.Errorf("readIndexEntry %s at offset %d failed: %v", oldIdxFileName, idx_offset, err) return fmt.Errorf("readIndexEntry %s at offset %d failed: %v", oldIdxFileName, idx_offset, err)
} }
key, offset, size := idxFileEntry(IdxEntry) key, offset, size := idxFileEntry(IdxEntry)
glog.V(0).Infof("key %d offset %d size %d", key, offset, size)
glog.V(4).Infof("key %d offset %d size %d", key, offset, size)
if _, found := incrementedHasUpdatedIndexEntry[key]; !found { if _, found := incrementedHasUpdatedIndexEntry[key]; !found {
incrementedHasUpdatedIndexEntry[key] = keyField{ incrementedHasUpdatedIndexEntry[key] = keyField{
offset: offset, offset: offset,
@ -193,7 +193,7 @@ func (v *Volume) makeupDiff(newDatFileName, newIdxFileName, oldDatFileName, oldI
//updated needle //updated needle
if incre_idx_entry.offset != 0 && incre_idx_entry.size != 0 && incre_idx_entry.size != TombstoneFileSize { if incre_idx_entry.offset != 0 && incre_idx_entry.size != 0 && incre_idx_entry.size != TombstoneFileSize {
//even the needle cache in memory is hit, the need_bytes is correct //even the needle cache in memory is hit, the need_bytes is correct
glog.V(0).Infof("file %d offset %d size %d", key, int64(incre_idx_entry.offset)*NeedlePaddingSize, incre_idx_entry.size)
glog.V(4).Infof("file %d offset %d size %d", key, int64(incre_idx_entry.offset)*NeedlePaddingSize, incre_idx_entry.size)
var needle_bytes []byte var needle_bytes []byte
needle_bytes, err = ReadNeedleBlob(oldDatFile, int64(incre_idx_entry.offset)*NeedlePaddingSize, incre_idx_entry.size) needle_bytes, err = ReadNeedleBlob(oldDatFile, int64(incre_idx_entry.offset)*NeedlePaddingSize, incre_idx_entry.size)
if err != nil { if err != nil {

4
weed/storage/volume_vacuum_test.go

@ -129,12 +129,12 @@ func doSomeWritesDeletes(i int, v *Volume, t *testing.T, infos []*needleInfo) {
size: size, size: size,
crc: n.Checksum, crc: n.Checksum,
} }
println("written file", i, "checksum", n.Checksum.Value(), "size", size)
// println("written file", i, "checksum", n.Checksum.Value(), "size", size)
if rand.Float64() < 0.5 { if rand.Float64() < 0.5 {
toBeDeleted := rand.Intn(i) + 1 toBeDeleted := rand.Intn(i) + 1
oldNeedle := newEmptyNeedle(uint64(toBeDeleted)) oldNeedle := newEmptyNeedle(uint64(toBeDeleted))
v.deleteNeedle(oldNeedle) v.deleteNeedle(oldNeedle)
println("deleted file", toBeDeleted)
// println("deleted file", toBeDeleted)
infos[toBeDeleted-1] = &needleInfo{ infos[toBeDeleted-1] = &needleInfo{
size: 0, size: 0,
crc: n.Checksum, crc: n.Checksum,

Loading…
Cancel
Save