Issue 37: Replicate delete

Reported by hieu.hcmus, Today (24 minutes ago)


What steps will reproduce the problem?
1.Create 2 volumes server same rack, replication type = 001
2.Upload a file
3.Delete file

What is the expected output? What do you see instead?
Expected output: File is deleted in both volume server
But: file is only deleted in one volume server

What version of the product are you using? On what operating system?
0.36
Please provide any additional information below.

After remove NeedleValue from NeedleMap, the size = 0 and it causes the
error.

I uploaded the patch to fix this error
This commit is contained in:
Chris Lu 2013-07-28 22:49:17 -07:00
parent 63ebafa113
commit 81debd73d4

View file

@ -221,15 +221,16 @@ func (v *Volume) delete(n *Needle) (uint32, error) {
//fmt.Println("key", n.Id, "volume offset", nv.Offset, "data_size", n.Size, "cached size", nv.Size)
if ok {
var err error
size := nv.Size
if err = v.nm.Delete(n.Id); err != nil {
return nv.Size, err
return size, err
}
if _, err = v.dataFile.Seek(0, 2); err != nil {
return nv.Size, err
return size, err
}
n.Data = make([]byte, 0)
_, err = n.Append(v.dataFile, v.Version())
return nv.Size, err
return size, err
}
return 0, nil
}