Skip to content

Commit

Permalink
Remove the unsupported global_distrib_addr option
Browse files Browse the repository at this point in the history
It was:
- not supported in the config spec, making it unusable
- documented with the old Erlang configuration format (cfg)
- untested
- placed in the wrong section of the configuration file (top level)
  • Loading branch information
chrzaszcz committed Mar 17, 2022
1 parent 122090b commit b78ffb3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
1 change: 0 additions & 1 deletion big_tests/tests/mod_global_distrib_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ groups() ->
%% with node 2 disabled
test_muc_conversation_on_one_host,
test_global_disco
%% TODO: Add test case fo global_distrib_addr option
]},
{hosts_refresher, [],
[test_host_refreshing]},
Expand Down
11 changes: 0 additions & 11 deletions doc/modules/mod_global_distrib.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,6 @@ Number of times message delivery will be retried in case of errors.

`mod_global_distrib` extension relies on [`mod_disco`](mod_disco.md)'s option `users_can_see_hidden_services`, when provided. If it is not configured, the default value is `true`. `mod_disco` does not have to be enabled for `mod_global_distrib` to work, as this parameter is used only for processing Disco requests by Global Distribution.

## Overriding remote datacenter endpoints

There may be cases when the endpoint list given via **endpoints** option does not accurately specify endpoints on which the node may be reached from other datacenters; e.g. in case the node is behind NAT, or in testing environment.
The endpoints used for connection to a remote datacenter may be overridden by global option `{ {global_distrib_addr, Host}, [{IP, Port}] }`.

## Example configuration

### Configuring mod_global_distrib
Expand All @@ -326,12 +321,6 @@ The endpoints used for connection to a remote datacenter may be overridden by gl
redis.pool = "global_distrib"
```

### Overriding endpoints to a remote datacenter

```erlang
{ {global_distrib_addr, "datacenter2.example.com"}, [{"124.12.4.3", 5556}, {"182.172.23.55", 5555}] }.
```

### Configuring Dynomite

For more information about Dynomite configuration, consult [Dynomite wiki](https://github.com/Netflix/dynomite/wiki).
Expand Down
7 changes: 1 addition & 6 deletions src/global_distrib/mod_global_distrib_server_mgr.erl
Original file line number Diff line number Diff line change
Expand Up @@ -408,12 +408,7 @@ refresh_connections(#state{ server = Server, pending_endpoints = PendingEndpoint

-spec get_endpoints(Server :: jid:lserver()) -> [mod_global_distrib_utils:endpoint()].
get_endpoints(Server) ->
EndpointsToResolve =
%% FIXME this option does not exist
case mongoose_config:lookup_opt({global_distrib_addr, Server}) of
{error, not_found} -> mod_global_distrib_mapping:endpoints(Server);
{ok, Endpoints} -> Endpoints
end,
EndpointsToResolve = mod_global_distrib_mapping:endpoints(Server),
mod_global_distrib_utils:resolve_endpoints(EndpointsToResolve).

-spec resolve_pending(NewEndpointList :: [mod_global_distrib_utils:endpoint()],
Expand Down

0 comments on commit b78ffb3

Please sign in to comment.