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

Failure to start if list of replicaSet seeds needs to be resolved to hostnames #160

Open
alexdias opened this issue Mar 13, 2017 · 3 comments

Comments

@alexdias
Copy link

Hi,

We've encountered an issue in which if we provide a list of seeds as ip addresses, the application will fail to start. I believe this is because mongo will provide the list of nodes as hostnames, and it seems the application will try to reinitialise the seeds after a node's process has been killed (and a seed's process is killed because it is not contained on the list of servers returned by mongo).

Here's a stacktrace:

7:15:05.999 [error] GenServer #PID<0.8895.4> terminating
** (MatchError) no match of right hand side value: []
    (mongodb) /examples/ex_collector/deps/mongodb/src/mongoc/mc_topology.erl:204: :mc_topology.parse_ismaster/4
    (mongodb) /examples/ex_collector/deps/mongodb/src/mongoc/mc_topology.erl:145: :mc_topology.handle_cast/2
    (stdlib) gen_server.erl:615: :gen_server.try_dispatch/4
    (stdlib) gen_server.erl:681: :gen_server.handle_msg/5
    (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {:DOWN, #Reference<0.0.1.39789>, :process, #PID<0.8880.4>, {{:badmatch, []}, [{:mc_topology, :parse_ismaster, 4, [file: '/examples/ex_collector/deps/mongodb/src/mongoc/mc_topology.erl', line: 204]}, {:mc_topology, :handle_cast, 2, [file: '/examples/ex_collector/deps/mongodb/src/mongoc/mc_topology.erl', line: 145]}, {:gen_server, :try_dispatch, 4, [file: 'gen_server.erl', line: 615]}, {:gen_server, :handle_msg, 5, [file: 'gen_server.erl', line: 681]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 240]}]}}
State: {:state, 'localhost', 27018, :undefined, :rsSecondary, :undefined, [size: 1, max_overflow: 10, overflow_ttl: 0, overflow_check_period: :undefined], 20000, 100, #PID<0.8880.4>, #Reference<0.0.1.39789>, [pool_size: 1], [database: "dataloop_app_dev"], {:mc_server, #PID<0.8895.4>, #Reference<0.0.8.35576>, "localhost:27018", :rsSecondary, "localhost:27018", 1864, 1864, "foo", 10790, [], 0, 4, ["localhost:27017", "localhost:27018", "localhost:27019"], [], [], :undefined, "localhost:27017", false, true}, #PID<0.8897.4>, :undefined}

A good example of a use case that will cause this is running a mongo replica set under docker.

I have a commit that will prevent a seed from being reinitialised if it has been deleted: outlyerapp@f167e13

Is that a workable solution?

Thanks!

@comtihon
Copy link
Owner

Hi, @alexdias
I'll investigate it, thanks for the issue.
I am in a process of refactoring mongoc and I'll pay attention to it.

@Ami-Kawashima
Copy link

I suffer the same. Hope you can solve it one day.

@dmsnell
Copy link
Contributor

dmsnell commented May 26, 2021

@alexdias and @Ami-Kawashima please try again from the latest master now that #236 has merged. I think there's a good chance it fixed your problems too.

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

No branches or pull requests

4 participants