Compare commits

...
3 Commits
Author SHA1 Message Date
Chris Lu 95ad56d99d 1.37 2019-06-21 20:56:34 -07:00
Chris Lu a111f26fe6 avoid nil
fix https://github.com/chrislusf/seaweedfs/issues/988
2019-06-21 20:56:27 -07:00
Chris Lu 308102f023 fix cassandra creation problem
fix https://github.com/chrislusf/seaweedfs/issues/986
2019-06-21 17:10:38 -07:00
4 changed files with 11 additions and 5 deletions

No files matched your search

+1 -1
View File
@@ -85,7 +85,7 @@ func (store *CassandraStore) FindEntry(ctx context.Context, fullpath filer2.Full
}
if len(data) == 0 {
return nil, fmt.Errorf("not found: %s", fullpath)
return nil, filer2.ErrNotFound
}
entry = &filer2.Entry{
+1 -1
View File
@@ -78,7 +78,7 @@ func (f *Filer) deleteChunksIfNotNew(oldEntry, newEntry *Entry) {
for _, oldChunk := range oldEntry.Chunks {
found := false
for _, newChunk := range newEntry.Chunks {
if oldChunk.Fid.Equals(newChunk.Fid) {
if filer_pb.ChunkEquals(oldChunk, newChunk) {
found = true
break
}
+8 -2
View File
@@ -21,8 +21,14 @@ func (fid *FileId) toFileId() string {
return needle.NewFileId(needle.VolumeId(fid.VolumeId), fid.FileKey, fid.Cookie).String()
}
func (fid *FileId) Equals(that *FileId) bool {
return fid.FileKey == that.FileKey && fid.VolumeId == that.VolumeId && fid.Cookie == that.Cookie
func ChunkEquals(this, that *FileChunk) bool {
if this.Fid == nil{
this.Fid, _ = toFileId(this.FileId)
}
if that.Fid == nil{
that.Fid, _ = toFileId(that.FileId)
}
return this.Fid.FileKey == that.Fid.FileKey && this.Fid.VolumeId == that.Fid.VolumeId && this.Fid.Cookie == that.Fid.Cookie
}
func BeforeEntrySerialization(chunks []*FileChunk) {
+1 -1
View File
@@ -5,5 +5,5 @@ import (
)
var (
VERSION = fmt.Sprintf("%s %d.%d", sizeLimit, 1, 36)
VERSION = fmt.Sprintf("%s %d.%d", sizeLimit, 1, 37)
)