[SERVER-18424] listDatabase command includes a database that was just dropped Created: 11/May/15  Updated: 21/Sep/15  Resolved: 21/Sep/15

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.1.2
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Kaloian Manassiev
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Sharded cluster, two shards, both standalone servers, 3 config servers, two mongos.


Attachments: Text File router27017.log    
Operating System: ALL
Steps To Reproduce:

In the shell:

mongos> use JavaDriverTest
switched to db JavaDriverTest
mongos> db.test.insert({})
WriteResult({ "nInserted" : 1 })
mongos> db.dropDatabase()
{ "dropped" : "JavaDriverTest", "ok" : 1 }
mongos> db.adminCommand("listDatabases")
{
	"databases" : [
		{
			"name" : "JavaDriverTest",
			"sizeOnDisk" : 570163200,
			"empty" : false,
			"shards" : {
				"sh01" : 570163200
			}
		},
                ...

Sprint: Sharding A (10/09/15)
Participants:

 Description   

After dropping a database, it still appears in the response from listDatabases.



 Comments   
Comment by Kaloian Manassiev [ 21/Sep/15 ]

jeff.yemin, our suspicion is that at the time, this bug was temporarily introduced by the catalog management refactoring we did early in the 3.2 development. We are unable to reproduce it anymore and suspect it must have been fixed later on.

I am resolving it now. If you end up hitting it again, please open a new bug.

Comment by Andy Schwerin [ 20/Aug/15 ]

jeff.yemin, do you have time to try to reproduce this on 3.1.7 once it's released?

Comment by Kaloian Manassiev [ 01/Jul/15 ]

Sorry for the delayed reply. We are still making changes to the metadata management and I would like to look at this when these changes have been settled.

In particular, we are planning of pulling out the chunk/shard operations outside of the metadata classes that represent these sharding concepts. This should take care of some concurrency bugs that are in there currently.

Comment by Jeffrey Yemin [ 12/May/15 ]

I've been able to reproduce this against 3.0.1. Attached is the mongos log file. I can attach additional logs if necessary. This is the snippet for a dropDatabase for which the database was still included in a subsequent listDatabases response:

2015-05-12T11:51:53.349-0400 I COMMAND  [conn73] DROP DATABASE: JavaDriverTest
2015-05-12T11:51:53.349-0400 I SHARDING [conn73] erased database JavaDriverTest from local registry
2015-05-12T11:51:53.349-0400 I SHARDING [conn73] couldn't find database [JavaDriverTest] in config db
2015-05-12T11:51:53.371-0400 I SHARDING [conn73] 	 put [JavaDriverTest] on: sh02:localhost:27218
2015-05-12T11:51:53.373-0400 I SHARDING [conn73] DBConfig::dropDatabase: JavaDriverTest
2015-05-12T11:51:53.373-0400 I SHARDING [conn73] about to log metadata event: { _id: "new-host-2.home-2015-05-12T15:51:53-55522199ed3fc6f3f4eba471", server: "new-host-2.home", clientAddr: "N/A", time: new Date(1431445913373), what: "dropDatabase.start", ns: "JavaDriverTest", details: {} }
2015-05-12T11:51:53.398-0400 I SHARDING [conn73]    DBConfig::dropDatabase: JavaDriverTest dropped sharded collections: 0
2015-05-12T11:51:53.398-0400 I SHARDING [conn73] about to log metadata event: { _id: "new-host-2.home-2015-05-12T15:51:53-55522199ed3fc6f3f4eba472", server: "new-host-2.home", clientAddr: "N/A", time: new Date(1431445913398), what: "dropDatabase", ns: "JavaDriverTest", details: {} }

Generated at Thu Feb 08 03:47:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.