mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
adjust log printing
This commit is contained in:
parent
d5d7ea59a1
commit
9d8a6d2562
|
@ -60,14 +60,14 @@ func LoadNeedleMap(file *os.File) (*NeedleMap, error) {
|
|||
nm.FileByteCounter = nm.FileByteCounter + uint64(size)
|
||||
if offset > 0 {
|
||||
oldSize := nm.m.Set(Key(key), offset, size)
|
||||
glog.V(3).Infoln("reading key", key, "offset", offset, "size", size, "oldSize", oldSize)
|
||||
glog.V(3).Infoln("reading key", key, "offset", offset*NeedlePaddingSize, "size", size, "oldSize", oldSize)
|
||||
if oldSize > 0 {
|
||||
nm.DeletionCounter++
|
||||
nm.DeletionByteCounter = nm.DeletionByteCounter + uint64(oldSize)
|
||||
}
|
||||
} else {
|
||||
oldSize := nm.m.Delete(Key(key))
|
||||
glog.V(3).Infoln("removing key", key, "offset", offset, "size", size, "oldSize", oldSize)
|
||||
glog.V(3).Infoln("removing key", key, "offset", offset*NeedlePaddingSize, "size", size, "oldSize", oldSize)
|
||||
nm.DeletionCounter++
|
||||
nm.DeletionByteCounter = nm.DeletionByteCounter + uint64(oldSize)
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ import (
|
|||
|
||||
func init() {
|
||||
cmdExport.Run = runExport // break init cycle
|
||||
cmdExport.IsDebug = cmdExport.Flag.Bool("debug", false, "enable debug mode")
|
||||
}
|
||||
|
||||
const (
|
||||
|
@ -105,14 +104,15 @@ func runExport(cmd *Command, args []string) bool {
|
|||
return nil
|
||||
}, true, func(n *storage.Needle, offset int64) error {
|
||||
nv, ok := nm.Get(n.Id)
|
||||
glog.V(3).Infoln("key", n.Id, "offset", offset, "size", n.Size, "disk_size", n.DiskSize(), "gzip", n.IsGzipped(), "ok", ok, "nv", nv)
|
||||
if ok && nv.Size > 0 {
|
||||
glog.V(3).Infof("key %d offset %d size %d disk_size %d gzip %v ok %v nv %+v",
|
||||
n.Id, offset, n.Size, n.DiskSize(), n.IsGzipped(), ok, nv)
|
||||
if ok && nv.Size > 0 && int64(nv.Offset)*8 == offset {
|
||||
return walker(vid, n, version)
|
||||
} else {
|
||||
if !ok {
|
||||
debug("This seems deleted", n.Id, "size", n.Size)
|
||||
glog.V(2).Infof("This seems deleted %d size %d", n.Id, n.Size)
|
||||
} else {
|
||||
debug("Id", n.Id, "size", n.Size)
|
||||
glog.V(2).Infof("Skipping later-updated Id %d size %d", n.Id, n.Size)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
|
|
@ -11,7 +11,6 @@ import (
|
|||
|
||||
func init() {
|
||||
cmdFix.Run = runFix // break init cycle
|
||||
cmdFix.IsDebug = cmdFix.Flag.Bool("debug", false, "enable debug mode")
|
||||
}
|
||||
|
||||
var cmdFix = &Command{
|
||||
|
@ -51,12 +50,12 @@ func runFix(cmd *Command, args []string) bool {
|
|||
err = storage.ScanVolumeFile(*fixVolumePath, *fixVolumeCollection, vid, func(superBlock storage.SuperBlock) error {
|
||||
return nil
|
||||
}, false, func(n *storage.Needle, offset int64) error {
|
||||
debug("key", n.Id, "offset", offset, "size", n.Size, "disk_size", n.DiskSize(), "gzip", n.IsGzipped())
|
||||
glog.V(2).Infof("key %d offset %d size %d disk_size %d gzip %v", n.Id, offset, n.Size, n.DiskSize(), n.IsGzipped())
|
||||
if n.Size > 0 {
|
||||
count, pe := nm.Put(n.Id, uint32(offset/storage.NeedlePaddingSize), n.Size)
|
||||
debug("saved", count, "with error", pe)
|
||||
glog.V(2).Infof("saved %d with error %v", count, pe)
|
||||
} else {
|
||||
debug("skipping deleted file ...")
|
||||
glog.V(2).Infof("skipping deleted file ...")
|
||||
return nm.Delete(n.Id)
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue