1

I am exploring sharded MongoDB clusters, and I have trouble understanding MongoS's behavior during a network split.

My test environment works as expected until I simulate a network split. In the "smallest" network partition, I have:

  • N MongoS servers
  • only 1 config server (out of 3 total), in SECONDARY status
  • and N shard servers

In this partition:

  • at first, all MongoDB servers + MongoS still accept connections and behave as expected
  • if I restart these MongoDB+MongoS servers => MongoS servers start but refuse connections (MongoNetworkError: connect ECONNREFUSED).

Do you know why? I must be missing something obvious. As far as I can tell from startup logs, MongoS sends queries like {"find":"shards", "readConcern":{"level":"majority"}} to the config server, which seems guaranteed to fail during a network split (Command timed out waiting for read concern to be satisfied).

Thanks for any help

  • Repro without shard servers: create a 3-server configuration replica set, only start one (to simulate a network split), and start MongoS based on that configuration replica set. MongoS starts but does not accept connections (ECONNREFUSED). – Nick Turner Sep 05 '22 at 19:01

0 Answers0