-
Notifications
You must be signed in to change notification settings - Fork 59
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
Fix cowHostList can't have hosts with same ConnectAddress
#185
Fix cowHostList can't have hosts with same ConnectAddress
#185
Conversation
cc58718
to
008c008
Compare
008c008
to
74e3404
Compare
host_source.go
Outdated
h.mu.Lock() | ||
defer h.mu.Unlock() | ||
addr, _ := h.connectAddressLocked() | ||
return net.JoinHostPort(addr.String(), strconv.Itoa(h.port)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These formatting changes are not related to this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but it is definitely formatting issues, here, for example, it had spaces instead of tabs, is there a way to get these type of changes in ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate PR I guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
policies_test.go
Outdated
"token 08 shuffling not configured": {hosts: []*HostInfo{ | ||
{hostId: "0", connectAddress: net.IPv4(10, 0, 0, 1), tokens: []string{"00", "10", "20"}}, | ||
{hostId: "1", connectAddress: net.IPv4(10, 0, 0, 3), tokens: []string{"25", "35", "45"}}, | ||
{hostId: "2", connectAddress: net.IPv4(10, 0, 0, 2), tokens: []string{"00", "10", "20"}}, | ||
{hostId: "3", connectAddress: net.IPv4(10, 0, 0, 4), tokens: []string{"25", "35", "45"}}, | ||
{hostId: "4", connectAddress: net.IPv4(10, 0, 0, 3), tokens: []string{"50", "60", "70"}}, | ||
{hostId: "5", connectAddress: net.IPv4(10, 0, 0, 4), tokens: []string{"50", "60", "70"}}, | ||
}, routingKey: "8", lwt: true, shuffle: false, want: []string{"0", "2", "3", "1"}}, | ||
}, routingKey: "8", lwt: true, shuffle: true, want: []string{"0", "2", "3", "4", "5", "1"}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you changing shuffling in this example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my fault, changed it back
74e3404
to
90c76fd
Compare
90c76fd
to
4736a31
Compare
@sylwiaszunejko , I can't make pipeline to pass, starting container is failing, it has nothing to do with this PR |
4736a31
to
1cb65c3
Compare
@dkropachev please rebase to master and the pipeline should pass then |
cowHostList uses HostInfo.Equal to confirm host uniqueness, which relies on `ConnectAddress.Equal`, which does not allow to have different hosts with same `ConnectAddress`
1cb65c3
to
3642984
Compare
Addresses issue from gocql/gocql
Reopening of a #182
Problem
cowHostList
usesHostInfo.Equal
to confirm host uniqueness, which relies onConnectAddress.Equal
.As result
cowHostList
does not allow to have different hosts with sameConnectAddress
.It breaks cases like accessing cluster via tcp or ssl proxy