[SERVER-18164] "show databases" may show non-existent databases on secondary nodes Created: 22/Apr/15  Updated: 27/Apr/15  Resolved: 22/Apr/15

Status: Closed
Project: Core Server
Component/s: Internal Code, Storage
Affects Version/s: 2.6.7
Fix Version/s: 3.0.0

Type: Bug Priority: Minor - P4
Reporter: nitzan dana Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operational


Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

When using a database that doesn't exist on a secondary node, and performing a find query - the database is created on the secondary only.
There's no way to delete it from the server due to "not master" error.
The only way to bypass it, is to create the database on the primary node and to drop it.

The commands for reproduce:
Secondary:
use ops_test
db.config.find(

{id:1}

)

Mongo version 2.6.7
Ubuntu 12.04.5 LTS
Mongo shell from bash



 Comments   
Comment by Kaloian Manassiev [ 27/Apr/15 ]

This is correct. If the service instance is restarted, these databases will go away.

Just to reiterate, this bug has been fixed in the 3.0 series.

Comment by nitzan dana [ 26/Apr/15 ]

In this case, if I reset the mongod service on this secondary machine, will this db vanish?

Thanks!

Comment by Kaloian Manassiev [ 22/Apr/15 ]

To clarify:
The database is not actually "created" (i.e., no files exist on disk). It only exists as an in-memory catalog entry, which unfortunately shows in the list databases command.

This has been fixed in 3.0 where we no longer create in-memory entries on each database access.

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