'why mongorestore hang when restore db in primary node?

I built a simple master-slave replication: members[0].priority = 10; members[2].prority = 0 and members[2].salveDelay = 80000。 Then i try to restore dbs in primary node, the mongorestore command hang: enter image description here



Solution 1:[1]

For DDL's like dropDatabase() the writeConcern is "majority", you have to wait till it is propagated to secondary, i.e. 80'000 seconds which is 22.2 hours!

See db.dropDatabase() - Replica Set and Sharded Clusters.

Same applies for createIndex() by default. However there you can specify commitQuorum

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Wernfried Domscheit