aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-10-28 01:14:05 -0700
committerChris Lu <chris.lu@gmail.com>2020-10-28 01:14:05 -0700
commit3e925faddd66c1287da843fb1878e7f7f4d31a71 (patch)
tree025715a7589af9a606a40ad36731541901a81a0d
parent73d924f1ee2e1cc85c125afa7119d3d710c3ba56 (diff)
downloadseaweedfs-3e925faddd66c1287da843fb1878e7f7f4d31a71.tar.xz
seaweedfs-3e925faddd66c1287da843fb1878e7f7f4d31a71.zip
trim out name extension
-rw-r--r--weed/storage/disk_location.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/weed/storage/disk_location.go b/weed/storage/disk_location.go
index 5dec21c32..1f58c9977 100644
--- a/weed/storage/disk_location.go
+++ b/weed/storage/disk_location.go
@@ -61,6 +61,7 @@ func parseCollectionVolumeId(base string) (collection string, vid needle.VolumeI
func (l *DiskLocation) loadExistingVolume(fileInfo os.FileInfo, needleMapKind NeedleMapType) bool {
name := fileInfo.Name()
if !fileInfo.IsDir() && strings.HasSuffix(name, ".idx") {
+ name := name[:len(name)-len(".idx")]
noteFile := l.Directory + "/" + name + ".note"
if util.FileExists(noteFile) {
note, _ := ioutil.ReadFile(noteFile)
@@ -93,7 +94,7 @@ func (l *DiskLocation) loadExistingVolume(fileInfo os.FileInfo, needleMapKind Ne
size, _, _ := v.FileStat()
glog.V(0).Infof("data file %s, replicaPlacement=%s v=%d size=%d ttl=%s",
- l.Directory+"/"+name, v.ReplicaPlacement, v.Version(), size, v.Ttl.String())
+ l.Directory+"/"+name+".dat", v.ReplicaPlacement, v.Version(), size, v.Ttl.String())
return true
}
return false