MongoDB Documentation, Release 3.0.4 When this happens, the primary member of the shard’s replica set then terminates to protect data consistency. If a secondary member can access the config database, data on the shard becomes accessible again after an election. The user will need to resolve the chunk migration failure independently. If you encounter this issue, contact the MongoDB User Group 23 or MongoDB Support 24 to address this issue. The sharded cluster balancing process controls both migrating chunks from decommissioned shards (i.e. draining) and normal cluster balancing activities. Consider the following behaviors for different versions of MongoDB in situations where you remove a shard in a cluster with an uneven chunk distribution: This document answers common questions about database replication in MongoDB. If you don’t find the answer you’re looking for, check the complete list of FAQs (page 743) or post your question to the MongoDB User Mailing List$^{25}$. MongoDB supports master-slave replication and a variation on master-slave replication known as replica sets. Replica sets are the recommended replication topology. Primary and master nodes are the nodes that can accept writes. MongoDB’s replication is “single-master:” only one node can accept write operations at a time. In a replica set, if the current “primary” node fails or becomes inaccessible, the other members can autonomously elect one of the other members of the set to be the new “primary”. By default, clients send all reads to the primary; however, read preference is configurable at the client level on a per-connection basis, which makes it possible to send reads to secondary nodes instead. Secondary and slave nodes are read-only nodes that replicate from the primary . Replication operates by way of an oplog , from which secondary/slave members apply new operations to themselves. This replication process is asynchronous, so secondary/slave nodes may not always reflect the latest writes to the $^{23}$http://groups.google.com/group/mongodb-user $^{24}$https://www.mongodb.org/about/support $^{25}$https://groups.google.com/forum/?fromgroups#!forum/mongodb-user Chapter 11. Frequently Asked Questions 768 11.6.3 What do the terms “secondary” and “slave” mean? 11.6.2 What do the terms “primary” and “master” mean? 11.6.1 What kinds of replication does MongoDB support? 11.6 FAQ: Replication and Replica Sets 11.5.27 How does draining a shard affect the balancing of uneven chunk distribu- tion? • After MongoDB 2.2, the balancer first removes the chunks from the draining shard and then balances the re- maining uneven chunk distribution. • Before MongoDB 2.2, the balancer handles the uneven chunk distribution and then removes the chunks from the draining shard.