Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update network.go by revisiting #5134 #5150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vivekkoya
Copy link
Contributor

@vivekkoya vivekkoya commented Jan 2, 2024

From the go source code on potential conflicts in IP Addressing schemes: https://cs.opensource.google/go/go/+/master:src/net/rawconn_unix_test.go
// There's no guarantee that IP-level socket
// options work well with dual stack sockets.
// A simple solution would be to take a look
// at the bound address to the raw connection
// and to classify the address family of the
// underlying socket by the bound address:
//
// - When IP.To16() != nil and IP.To4() == nil,
// we can assume that the raw connection
// consists of an IPv6 socket using only
// IPv6 addresses.
//
// - When IP.To16() == nil and IP.To4() != nil,
// the raw connection consists of an IPv4
// socket using only IPv4 addresses.
//
// - Otherwise, the raw connection is a dual
// stack socket, an IPv6 socket using IPv6
// addresses including IPv4-mapped or
// IPv4-embedded IPv6 addresses.

What problem are we solving?

How are we solving the problem?

How is the PR tested?

Checks

  • I have added unit tests if possible.
  • I will add related wiki document changes and link to this PR after merging.

From the go source code on potential conflicts in IP Addressing schemes: https://cs.opensource.google/go/go/+/master:src/net/rawconn_unix_test.go
			// There's no guarantee that IP-level socket
			// options work well with dual stack sockets.
			// A simple solution would be to take a look
			// at the bound address to the raw connection
			// and to classify the address family of the
			// underlying socket by the bound address:
			//
			// - When IP.To16() != nil and IP.To4() == nil,
			//   we can assume that the raw connection
			//   consists of an IPv6 socket using only
			//   IPv6 addresses.
			//
			// - When IP.To16() == nil and IP.To4() != nil,
			//   the raw connection consists of an IPv4
			//   socket using only IPv4 addresses.
			//
			// - Otherwise, the raw connection is a dual
			//   stack socket, an IPv6 socket using IPv6
			//   addresses including IPv4-mapped or
			//   IPv4-embedded IPv6 addresses.
@chrislusf
Copy link
Collaborator

running on Mac:

chrislu/tmp ()  > weed server -options=local1.option
I0102 16:12:31.064095 master.go:269 current: fe80::1:9333 peers:
I0102 16:12:31.068461 file_util.go:27 Folder /Users/chrislu/tmp/99 Permission: -rwxr-xr-x
I0102 16:12:31.068633 master.go:269 current: fe80::1:9333 peers:[fe80::1]:9333
I0102 16:12:31.068629 file_util.go:27 Folder /Users/chrislu/tmp/99 Permission: -rwxr-xr-x
I0102 16:12:31.068761 master_server.go:127 Volume Size Limit is 1000 MB
I0102 16:12:31.068981 master.go:150 Start Seaweed Master 30GB 3.60  at [fe80::1]:9333
F0102 16:12:31.069251 master.go:153 Master startup error: listen tcp [fe80::1]:9333: bind: can't assign requested address
goroutine 93 [running]:
github.com/seaweedfs/seaweedfs/weed/glog.stacks(0x0)
	/Users/chrislu/go/src/github.com/seaweedfs/seaweedfs/weed/glog/glog.go:768 +0x85
github.com/seaweedfs/seaweedfs/weed/glog.(*loggingT).output(0x1038f6800, 0x3, 0xc000121810, {0x102c42b15?, 0xc00066fdc8?}, 0x1?, 0x0)
	/Users/chrislu/go/src/github.com/seaweedfs/seaweedfs/weed/glog/glog.go:719 +0x38a
github.com/seaweedfs/seaweedfs/weed/glog.(*loggingT).printf(0xc0001374a0?, 0x7?, {0x101f8a1e5, 0x18}, {0xc00066fdc8, 0x1, 0x1})
	/Users/chrislu/go/src/github.com/seaweedfs/seaweedfs/weed/glog/glog.go:657 +0x10a
github.com/seaweedfs/seaweedfs/weed/glog.Fatalf(...)
	/Users/chrislu/go/src/github.com/seaweedfs/seaweedfs/weed/glog/glog.go:1154
github.com/seaweedfs/seaweedfs/weed/command.startMaster({0xc0003a0f80, 0xc0003a0f98, 0xc000909dc0, 0xc000909dc0, 0xc0005abf80, 0xc0002c7c10, 0xc0003a0fa0, 0xc0003a0fb5, 0xc0005abfc0, 0xc0003a0fc0, ...}, ...)
	/Users/chrislu/go/src/github.com/seaweedfs/seaweedfs/weed/command/master.go:153 +0x39c
created by github.com/seaweedfs/seaweedfs/weed/command.runServer in goroutine 1
	/Users/chrislu/go/src/github.com/seaweedfs/seaweedfs/weed/command/server.go:310 +0xb2a
I0102 16:12:31.070744 volume_grpc_client_to_master.go:43 checkWithMaster [fe80::1]:9333: get master [fe80::1]:9333 configuration: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp [fe80::1]:19333: connect: no route to host"

The options file content:

chrislu/tmp ()  > cat local1.option
dir=/Users/chrislu/tmp/99
master.volumeSizeLimitMB=1000
master.port=9333
volume.max=0
volume.port=8085
volume.preStopSeconds=1
filer=true
filer.port=8888
localSocket=/tmp/abcd/xx.sock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants