Consider a shard cluster:
- Has only one shard, but the shard has 3 replicas A, B, C
- Has 3 mongos instances
- mongos and mongod instance are running across 3 different data centers.
- The primary node (A) of the replica set is in Data center 1
It will look like this:
Data Center 1 | Data Center 2 | Data Center 3 mongos 1 | mongos 2 | mongos 3 Primary node (A) | secondary node (B) | secondary node (C)
Now, suppose there is a network partition between Data center 1 and 2, A and B cannot see each other, but C can see both. In this case, if I understand correctly, B will try to elect itself to be the primary, but it will fail because A can still see the majority of the replica sets (A and C), and C can still see A.
In this case, if a client talks to the mongos 2 which is running in DataCenter 2, will all the read and write operation for this client fail because the network between Data Center 1 and Data Center 2 is broken, so it cannot reach the primary node?