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)
|
nm.FileByteCounter = nm.FileByteCounter + uint64(size)
|
||||||
if offset > 0 {
|
if offset > 0 {
|
||||||
oldSize := nm.m.Set(Key(key), offset, size)
|
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 {
|
if oldSize > 0 {
|
||||||
nm.DeletionCounter++
|
nm.DeletionCounter++
|
||||||
nm.DeletionByteCounter = nm.DeletionByteCounter + uint64(oldSize)
|
nm.DeletionByteCounter = nm.DeletionByteCounter + uint64(oldSize)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
oldSize := nm.m.Delete(Key(key))
|
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.DeletionCounter++
|
||||||
nm.DeletionByteCounter = nm.DeletionByteCounter + uint64(oldSize)
|
nm.DeletionByteCounter = nm.DeletionByteCounter + uint64(oldSize)
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,6 @@ import (
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmdExport.Run = runExport // break init cycle
|
cmdExport.Run = runExport // break init cycle
|
||||||
cmdExport.IsDebug = cmdExport.Flag.Bool("debug", false, "enable debug mode")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -105,14 +104,15 @@ func runExport(cmd *Command, args []string) bool {
|
||||||
return nil
|
return nil
|
||||||
}, true, func(n *storage.Needle, offset int64) error {
|
}, true, func(n *storage.Needle, offset int64) error {
|
||||||
nv, ok := nm.Get(n.Id)
|
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)
|
glog.V(3).Infof("key %d offset %d size %d disk_size %d gzip %v ok %v nv %+v",
|
||||||
if ok && nv.Size > 0 {
|
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)
|
return walker(vid, n, version)
|
||||||
} else {
|
} else {
|
||||||
if !ok {
|
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 {
|
} 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
|
return nil
|
||||||
|
|
|
@ -11,7 +11,6 @@ import (
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
cmdFix.Run = runFix // break init cycle
|
cmdFix.Run = runFix // break init cycle
|
||||||
cmdFix.IsDebug = cmdFix.Flag.Bool("debug", false, "enable debug mode")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var cmdFix = &Command{
|
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 {
|
err = storage.ScanVolumeFile(*fixVolumePath, *fixVolumeCollection, vid, func(superBlock storage.SuperBlock) error {
|
||||||
return nil
|
return nil
|
||||||
}, false, func(n *storage.Needle, offset int64) error {
|
}, 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 {
|
if n.Size > 0 {
|
||||||
count, pe := nm.Put(n.Id, uint32(offset/storage.NeedlePaddingSize), n.Size)
|
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 {
|
} else {
|
||||||
debug("skipping deleted file ...")
|
glog.V(2).Infof("skipping deleted file ...")
|
||||||
return nm.Delete(n.Id)
|
return nm.Delete(n.Id)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue