Which commits solve the issue about dropping and recreating a db with same name?

Hi, all.

I try to find the jira and solution in mongo 4.4 which solves the problem that still exists in 4.0, 4.2, but not found.

Anyone who can tell the jira links ?


I believe this is the issue you’re looking for SERVER-33973. Looks like it was backported to 4.2.1 as well. That said, in looking at the linked ticket, SERVER-17397, it appears that you still need to run the drop 2 times to sure. I’ll check that the documentation matches reality.


Thanks. Please have a check and let me know whether the documentation is up-to-date. The solution that restarts all mongos and mongod is quite unacceptable, so we’re eager to know the light-weight solution.

I have double checked that the documentation is not quite right. I’ve created DOCS-14619 to update the docs. But as you can see in the linked SERVER ticket, starting in 4.4, you still need to call dropDatabases 2 times from the mongos to be sure that you can re-create a collection in the same namespace. In 4.2.1 and later, you still need to follow this procedure:

  1. Drop the database / collection using a mongos
  2. Rerun the drop command using a mongos
  3. Connect to each mongos and run flushRouterConfig
1 Like

Hi Lewis, not sure if you were watching the ticket, but the dropDatabase command for sharded clusters is now fixed in 5.0.0. See the last comment on the ticket.


This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.