Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MB-54349 Handle ssl port when getting indexes
When getting the list of indexes from the indexer we weren't considering
the host:port could be using the ssl port. With this change we now do.

Change-Id: Ie9360643ded50a6282704ff89369b4b221de801f
Reviewed-on: https://review.couchbase.org/c/ns_server/+/182120
Well-Formed: Restriction Checker
Tested-by: Build Bot <build@couchbase.com>
Tested-by: Steve Watanabe <steve.watanabe@couchbase.com>
Reviewed-by: Artem Stemkovski <artem@couchbase.com>
  • Loading branch information
stevewatanabe committed Nov 1, 2022
1 parent 6c52c5b commit da2fd33
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/menelaus_stats.erl
Expand Up @@ -2819,11 +2819,16 @@ get_indexes(Service, BucketId) ->

do_get_indexes(Service, BucketId0, Nodes) ->
WantedHosts0 =
[begin
{_, Host} = misc:node_name_host(N),
Port = service_ports:get_port(rest_port, ns_config:latest(), N),
list_to_binary(misc:join_host_port(Host, Port))
end || N <- Nodes],
lists:flatmap(
fun (N) ->
{_, Host} = misc:node_name_host(N),
Port = service_ports:get_port(rest_port, ns_config:latest(),
N),
SslPort = service_ports:get_port(ssl_rest_port,
ns_config:latest(), N),
[list_to_binary(misc:join_host_port(Host, Port)),
list_to_binary(misc:join_host_port(Host, SslPort))]
end, Nodes),
WantedHosts = lists:usort(WantedHosts0),

BucketId = list_to_binary(BucketId0),
Expand Down

0 comments on commit da2fd33

Please sign in to comment.