Browse Source

fix deleting inconsistent problems

pull/247/head
Meng Shi 10 years ago
parent
commit
894bcc948d
  1. 22
      go/topology/store_replicate.go
  2. BIN
      weed

22
go/topology/store_replicate.go

@ -56,13 +56,14 @@ func ReplicatedDelete(masterNode string, store *storage.Store,
//check JWT
jwt := security.GetJwt(r)
ret, err := store.Delete(volumeId, n)
if err != nil {
glog.V(0).Infoln("delete error:", err)
return
}
needToReplicate := !store.HasVolume(volumeId)
// fix in 0.70 beta
// Contributions: Meng Shi (rookie-xy)
// date: 2016-01-22 16:02:55
// reason:
// When using the replication technique, found deleting
// inconsistent (or called sync deletion) problems.
//
needToReplicate := store.HasVolume(volumeId)
if !needToReplicate && ret > 0 {
needToReplicate = store.GetVolume(volumeId).NeedToReplicate()
}
@ -72,9 +73,16 @@ func ReplicatedDelete(masterNode string, store *storage.Store,
return nil == util.Delete("http://"+location.Url+r.URL.Path+"?type=replicate", jwt)
}) {
ret = 0
return
}
}
}
ret, err := store.Delete(volumeId, n)
if err != nil {
glog.V(0).Infoln("delete error:", err)
return
}
return
}

BIN
weed

Loading…
Cancel
Save