[SERVER-1149] don't allow dbs with different casing (WAS: Using not existing Database in shell client should not stop the database server) Created: 25/May/10  Updated: 12/Jul/16  Resolved: 15/Jun/10

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 1.4.2
Fix Version/s: 1.5.3

Type: Bug Priority: Critical - P2
Reporter: Steve Wagner Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 2008 Server R2 x64


Participants:

 Description   

We have a database called "Test" in our server. It happens often that a developer type "test" instead and try to use that database. In this case the server stops because he can not find the database files for "test".

This should not be happen, because someone could cause a stop of a production server this way.



 Comments   
Comment by auto [ 15/Jun/10 ]

Author:

{'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

Message: test i forgot to commit for SERVER-1149
http://github.com/mongodb/mongo/commit/d3481595d2fedb3774574387c06ab70679aae447

Comment by Eliot Horowitz (Inactive) [ 15/Jun/10 ]

probably not - certainly not yet at least.

needs some real world testing

Comment by Justin Dearing [ 15/Jun/10 ]

Can this be back ported to 1.4/4?

I will test this today with and without --directoryperdb

Comment by auto [ 15/Jun/10 ]

Author:

{'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

Message: don't allow databases with the same name and different casing SERVER-1149
http://github.com/mongodb/mongo/commit/1113a12a59214ae0ae624c00af51a64609de2913

Comment by Eliot Horowitz (Inactive) [ 15/Jun/10 ]

This will be fixed in 1.5.3.

Comment by Justin Dearing [ 15/Jun/10 ]

I took a quick look at this. Threw some more logging in the code for increased visibility. This annoys me as a windows user too.

Is this for sure to be fixed in 1.53? If I were to provide a patch with increased logging that made the cause of the issue more apparent would that speed up resolution.

Obviously if I manage to actually fix the issue I'll submit that too, but I have a feeling whatever solution I submitted would be sub optimal.

Finally on a more specific note, If I made a class that inherited from the HashTable template class that held the collections, made it hole keys of std::string, and added a case insinsitive find called ifind() as part of this solution would that be acceptable? Not sure if that will solve the problem yet, but it might be part of a solution.

Comment by Steve Wagner [ 14/Jun/10 ]

Any progress on that?

I can not sell MongoDB to my manager if a developer can kill the production database with only one wrong cased char.

Comment by Steve Wagner [ 25/May/10 ]

If the Database name is "Test" and i run that on the client:

use test
db.test.find()

The server exits with the following message:

Tue May 25 15:50:22 end connection 10.10.11.167:51991
Tue May 25 15:50:55 connection accepted from 10.10.11.221:19998 #157
Create/OpenFile failed C:/mongodb/data/test.ns 0
Tue May 25 15:51:02 couldn't open file C:/mongodb/data/test.ns terminating
Tue May 25 15:51:02 dbexit:
Tue May 25 15:51:02 shutdown: going to close listening sockets...
Tue May 25 15:51:02 going to close listening socket: 172
Tue May 25 15:51:02 Listener: accept() returns -1 errno:0 No error
Tue May 25 15:51:02 got request after shutdown()
Tue May 25 15:51:02 going to close listening socket: 188
Tue May 25 15:51:02 MiniWebServer: accept() returns -1 errno:0 No error
Tue May 25 15:51:02 shutdown: going to flush oplog...
Tue May 25 15:51:02 shutdown: going to close sockets...
Tue May 25 15:51:02 shutdown: waiting for fs preallocator...
Tue May 25 15:51:02 shutdown: closing all files...
Tue May 25 15:51:02 closeAllFiles() finished
Tue May 25 15:51:02 dbexit: really exiting now

Used filesystem is NTFS.

Comment by Eliot Horowitz (Inactive) [ 25/May/10 ]

Also - what file system are you using?

Comment by Eliot Horowitz (Inactive) [ 25/May/10 ]

What do you mean "stop the database"
In general this isn't the case.
Can you attach the db logs?

Generated at Thu Feb 08 02:56:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.