aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/needle_map_memory.go
diff options
context:
space:
mode:
authorKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2024-05-12 23:31:34 +0500
committerGitHub <noreply@github.com>2024-05-12 11:31:34 -0700
commitd389c5b27e6ceef6fb623c0c2b8405c754d3ac5d (patch)
tree4a5a7272e3a652468e442f5306744ec27cd043dc /weed/storage/needle_map_memory.go
parent731b3aadbeacc7754f5b91ce1b3f9b96eb428f3f (diff)
downloadseaweedfs-d389c5b27e6ceef6fb623c0c2b8405c754d3ac5d.tar.xz
seaweedfs-d389c5b27e6ceef6fb623c0c2b8405c754d3ac5d.zip
fix: recreate index include deleted files (#5579)
* fix: recreate index include deleted files https://github.com/seaweedfs/seaweedfs/issues/5508 * fix: counting the number of files * fix: log
Diffstat (limited to 'weed/storage/needle_map_memory.go')
-rw-r--r--weed/storage/needle_map_memory.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/storage/needle_map_memory.go b/weed/storage/needle_map_memory.go
index a2beb6c33..c75514a31 100644
--- a/weed/storage/needle_map_memory.go
+++ b/weed/storage/needle_map_memory.go
@@ -36,8 +36,8 @@ func LoadCompactNeedleMap(file *os.File) (*NeedleMap, error) {
func doLoading(file *os.File, nm *NeedleMap) (*NeedleMap, error) {
e := idx.WalkIndexFile(file, 0, func(key NeedleId, offset Offset, size Size) error {
nm.MaybeSetMaxFileKey(key)
- nm.FileCounter++
if !offset.IsZero() && size.IsValid() {
+ nm.FileCounter++
nm.FileByteCounter = nm.FileByteCounter + uint64(size)
oldOffset, oldSize := nm.m.Set(NeedleId(key), offset, size)
if !oldOffset.IsZero() && oldSize.IsValid() {
@@ -51,7 +51,7 @@ func doLoading(file *os.File, nm *NeedleMap) (*NeedleMap, error) {
}
return nil
})
- glog.V(1).Infof("max file key: %d for file: %s", nm.MaxFileKey(), file.Name())
+ glog.V(1).Infof("max file key: %v count: %d deleted: %d for file: %s", nm.MaxFileKey(), nm.FileCount(), nm.DeletedCount(), file.Name())
return nm, e
}