mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-14 18:17:34 +08:00
Reduce memory usage for "weed fix"
This commit is contained in:
@@ -102,7 +102,7 @@ func runExport(cmd *Command, args []string) bool {
|
||||
err = storage.ScanVolumeFile(*exportVolumePath, *exportCollection, vid, func(superBlock storage.SuperBlock) error {
|
||||
version = superBlock.Version
|
||||
return nil
|
||||
}, func(n *storage.Needle, offset int64) error {
|
||||
}, 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 {
|
||||
|
@@ -49,7 +49,7 @@ func runFix(cmd *Command, args []string) bool {
|
||||
vid := storage.VolumeId(*fixVolumeId)
|
||||
err = storage.ScanVolumeFile(*fixVolumePath, *fixVolumeCollection, vid, func(superBlock storage.SuperBlock) error {
|
||||
return nil
|
||||
}, 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())
|
||||
if n.Size > 0 {
|
||||
count, pe := nm.Put(n.Id, uint32(offset/storage.NeedlePaddingSize), n.Size)
|
||||
|
Reference in New Issue
Block a user