aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2013-07-28 22:49:17 -0700
committerChris Lu <chris.lu@gmail.com>2013-07-28 22:49:17 -0700
commit81debd73d4fa29bd9cb65d39baae44013089ef7b (patch)
tree0391f577b4b29f3a50bdf261aee678452ce9c0fc
parent63ebafa113d0e9db11e85c8f199bc2b95a5cc84e (diff)
downloadseaweedfs-81debd73d4fa29bd9cb65d39baae44013089ef7b.tar.xz
seaweedfs-81debd73d4fa29bd9cb65d39baae44013089ef7b.zip
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
-rw-r--r--go/storage/volume.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/go/storage/volume.go b/go/storage/volume.go
index bd11f48c6..9f16dd638 100644
--- a/go/storage/volume.go
+++ b/go/storage/volume.go
@@ -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
}