diff options
| author | Timur Nurutdinov <t.nurutdinov@corp.mail.ru> | 2015-08-18 19:58:45 +0300 |
|---|---|---|
| committer | Timur Nurutdinov <t.nurutdinov@corp.mail.ru> | 2015-08-18 19:58:45 +0300 |
| commit | 4b0904e9c4a06a369d666a0b730f6f573db23952 (patch) | |
| tree | a923a46410557ec2ca66e56e1e6c353cc972395c /go | |
| parent | 7d1e9a6b8a45852881c872f1f752bcaa78520639 (diff) | |
| download | seaweedfs-4b0904e9c4a06a369d666a0b730f6f573db23952.tar.xz seaweedfs-4b0904e9c4a06a369d666a0b730f6f573db23952.zip | |
fix extract collection name from .dat file
Diffstat (limited to 'go')
| -rw-r--r-- | go/storage/store.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/go/storage/store.go b/go/storage/store.go index b37175f11..ebf01d09f 100644 --- a/go/storage/store.go +++ b/go/storage/store.go @@ -207,7 +207,7 @@ func (l *DiskLocation) loadExistingVolumes(needleMapKind NeedleMapType) { if !dir.IsDir() && strings.HasSuffix(name, ".dat") { collection := "" base := name[:len(name)-len(".dat")] - i := strings.Index(base, "_") + i := strings.LastIndex(base, "_") if i > 0 { collection, base = base[0:i], base[i+1:] } @@ -216,6 +216,8 @@ func (l *DiskLocation) loadExistingVolumes(needleMapKind NeedleMapType) { if v, e := NewVolume(l.Directory, collection, vid, needleMapKind, nil, nil); e == nil { l.volumes[vid] = v glog.V(0).Infof("data file %s, replicaPlacement=%s v=%d size=%d ttl=%s", l.Directory+"/"+name, v.ReplicaPlacement, v.Version(), v.Size(), v.Ttl.String()) + } else { + glog.V(0).Infof("new volume %s error %s", name, e) } } } |
