Browse Source

fix chunk manifest replicate upload error

pull/279/head
tnextday 10 years ago
parent
commit
709c969550
  1. 16
      go/topology/store_replicate.go
  2. 2
      go/util/constants.go

16
go/topology/store_replicate.go

@ -11,6 +11,7 @@ import (
"github.com/chrislusf/seaweedfs/go/storage" "github.com/chrislusf/seaweedfs/go/storage"
"github.com/chrislusf/seaweedfs/go/util" "github.com/chrislusf/seaweedfs/go/util"
"net" "net"
"net/url"
) )
func ReplicatedWrite(masterNode string, s *storage.Store, func ReplicatedWrite(masterNode string, s *storage.Store,
@ -29,8 +30,19 @@ func ReplicatedWrite(masterNode string, s *storage.Store,
//send to other replica locations //send to other replica locations
if r.FormValue("type") != "replicate" { if r.FormValue("type") != "replicate" {
if !distributedOperation(masterNode, s, volumeId, func(location operation.Location) bool { if !distributedOperation(masterNode, s, volumeId, func(location operation.Location) bool {
_, err := operation.Upload(
"http://"+location.Url+r.URL.Path+"?type=replicate&ts="+strconv.FormatUint(needle.LastModified, 10),
args := url.Values{
"type": {"replicate"},
}
if needle.LastModified > 0 {
args.Set("ts", strconv.FormatUint(needle.LastModified, 10))
}
if needle.IsChunkedManifest() {
args.Set("cm", "true")
}
u := util.MkUrl(location.Url, r.URL.Path, args)
needle.IsChunkedManifest()
_, err := operation.Upload(u,
string(needle.Name), bytes.NewReader(needle.Data), needle.IsGzipped(), string(needle.Mime), string(needle.Name), bytes.NewReader(needle.Data), needle.IsGzipped(), string(needle.Mime),
jwt) jwt)
return err == nil return err == nil

2
go/util/constants.go

@ -1,5 +1,5 @@
package util package util
const ( const (
VERSION = "0.70 beta"
VERSION = "0.71 beta"
) )
Loading…
Cancel
Save