Browse Source

fix issue 986

fix issue 986
pull/991/head
Chris Lu 6 years ago
parent
commit
059ef879a8
  1. 2
      weed/filer2/filer_deletion.go
  2. 4
      weed/pb/filer_pb/filer_pb_helper.go

2
weed/filer2/filer_deletion.go

@ -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.FileId == newChunk.FileId {
if oldChunk.Fid.Equals(newChunk.Fid) {
found = true
break
}

4
weed/pb/filer_pb/filer_pb_helper.go

@ -21,6 +21,10 @@ 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 BeforeEntrySerialization(chunks []*FileChunk) {
for _, chunk := range chunks {

Loading…
Cancel
Save