I have a replica set with 1 primary, 1 secondary and 1 arbiter. When I close secondary member, I cannot drop a database. It waits for something. However, if I open secondary member, dropDatabase is okay. What is the reason of this? Can't we drop database without any secondary member?
Asked
Active
Viewed 463 times
2
-
Which version of MongoDB are you using? – Robert Seaman Mar 13 '19 at 08:11
-
What do you mean "When I close secondary member"? – Neodan Mar 13 '19 at 08:32
-
I tried with 3.6 and 4.0.2 versions. I mean I stop the service. – kubra ozgoc Mar 14 '19 at 07:39
1 Answers
3
Since MongoDB 3.6, dropDatabase
now carries a writeConcern
. This is set to majority
by default. This means, in a replicaset cluster of 3, at least 2 data-bearing nodes (not arbiters) need to apply the same change.
If you really want, you can force dropDatabase
to complete using just one data-bearing node by using a writeConcern
of 1
. However, this can cause a rollback.
For more information on writeConcern
and how to set it, please refer to the docs:
https://docs.mongodb.com/manual/reference/write-concern/

Robert Seaman
- 2,432
- 15
- 18
-
-
That's great to hear! Please mark this as the accepted answer if you feel it could help others too. – Robert Seaman Mar 14 '19 at 09:58