Skip to content

Commit

Permalink
fix(cluster) using default_port for peers addresses
Browse files Browse the repository at this point in the history
Clusters with nodes not running on the default `9042` port couldn't be
properly reached. Thanks @allisthere2love for the investigation.

This issue was never encountered before and my guess is because such
clusters added their contact_points including the port (`x.x.x.x:9043`),
and the driver could connect to it, but not to the other nodes, since it
was trying `9042` on those. So it simply considered the other nodes as
DOWN, and thus still works (if one doesn't check the logs and those lags
are not displaying warnings, it seems like nothing is going wrong).
However @allisthere2love had nodes from another C* cluster listening on
`9042`, leading to inconsistencies and thus, actual errors that allowed
us to track it down.

As per other datastax drivers, all nodes of a cluster must listen on the
same port.

Fix #47
See Kong/kong#1139
  • Loading branch information
thibaultcha committed Apr 11, 2016
1 parent 9a7910b commit 1f66685
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cassandra.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ function Cassandra.refresh_hosts(options)
end

for _, row in ipairs(rows) do
local address = options.policies.address_resolution(row["rpc_address"])
local address = options.policies.address_resolution(row["rpc_address"], options.protocol_options.default_port)
log.info("Adding host "..address)
hosts[address] = {
unhealthy_at = 0,
Expand Down

0 comments on commit 1f66685

Please sign in to comment.