aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-03-13 12:05:04 -0800
committerChris Lu <chris.lu@gmail.com>2021-03-13 12:05:04 -0800
commit22ef015cfffb3217f25bf3901b6af53c07bb74da (patch)
tree5a3d20ca13304933eee398ed76e5117b82ffdf28
parent56953b207d771a0bf8b799576d8a6e50bc2cd5af (diff)
downloadseaweedfs-22ef015cfffb3217f25bf3901b6af53c07bb74da.tar.xz
seaweedfs-22ef015cfffb3217f25bf3901b6af53c07bb74da.zip
this performs poorly and unstable
-rw-r--r--weed/server/volume_server_udp_handlers.go3
-rw-r--r--weed/wdclient/volume_udp_client.go15
2 files changed, 15 insertions, 3 deletions
diff --git a/weed/server/volume_server_udp_handlers.go b/weed/server/volume_server_udp_handlers.go
index e0dc94310..2f7563f4c 100644
--- a/weed/server/volume_server_udp_handlers.go
+++ b/weed/server/volume_server_udp_handlers.go
@@ -41,6 +41,7 @@ func (vs *VolumeServer) ServeTFTP(r tftp.ReadRequest) {
func (vs *VolumeServer) ReceiveTFTP(w tftp.WriteRequest) {
filename := w.Name()
+ println("+ ", filename)
// Get the file size
size, err := w.Size()
@@ -75,4 +76,6 @@ func (vs *VolumeServer) ReceiveTFTP(w tftp.WriteRequest) {
return
}
+ println("- ", filename)
+
}
diff --git a/weed/wdclient/volume_udp_client.go b/weed/wdclient/volume_udp_client.go
index 2daf37bfc..b8bdcec90 100644
--- a/weed/wdclient/volume_udp_client.go
+++ b/weed/wdclient/volume_udp_client.go
@@ -3,8 +3,8 @@ package wdclient
import (
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb"
- "pack.ag/tftp"
"io"
+ "pack.ag/tftp"
)
// VolumeTcpClient put/get/delete file chunks directly on volume servers without replication
@@ -23,15 +23,24 @@ func (c *VolumeUdpClient) PutFileChunk(volumeServerAddress string, fileId string
return parseErr
}
- udpClient, _ := tftp.NewClient()
+ udpClient, _ := tftp.NewClient(
+ tftp.ClientMode(tftp.ModeOctet),
+ tftp.ClientBlocksize(9000),
+ tftp.ClientWindowsize(16),
+ tftp.ClientTimeout(1),
+ tftp.ClientTransferSize(true),
+ tftp.ClientRetransmit(3),
+ )
- fileUrl := "tftp://"+udpAddress+"/"+fileId
+ fileUrl := "tftp://" + udpAddress + "/" + fileId
+ // println("put", fileUrl, "...")
err = udpClient.Put(fileUrl, fileReader, int64(fileSize))
if err != nil {
glog.Errorf("udp put %s: %v", fileUrl, err)
return
}
+ // println("sent", fileUrl)
return
}