[SERVER-23976] repairDatabase command on a new, different-cased database terminates server Created: 28/Apr/16  Updated: 03/Jan/18  Resolved: 21/Nov/16

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 3.3.3
Fix Version/s: 3.5.1

Type: Bug Priority: Major - P3
Reporter: Kamran K. Assignee: Daniel Gottlieb (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
is duplicated by SERVER-22434 Running repairDatabase on non-existin... Closed
Related
is related to SERVER-24563 Secondary crash when inserting docume... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Storage 2016-11-21, Storage 2016-12-12
Participants:
Case:
Linked BF Score: 0

 Description   

In versions prior to 3.3.3, running repairDatabase on a new, different-cased database returns this error:

{
	"ok" : 0,
	"errmsg" : "db already exists with different case already have: [a] trying to create [A]",
	"code" : 13297
}

In 3.3.3+, the same command terminates the server:

2016-04-28T16:11:12.503-0400 F STORAGE  [conn1] Unexpected exception encountered while reopening database after repair.
2016-04-28T16:11:12.503-0400 F -        [conn1] terminate() called. An exception is active; attempting to gather more information
2016-04-28T16:11:12.560-0400 F -        [conn1] DBException::toString(): 13297 db already exists with different case already have: [a] trying to create [A]
Actual exception type: mongo::UserException



 Comments   
Comment by Githook User [ 21/Nov/16 ]

Author:

{u'username': u'dgottlieb', u'name': u'Daniel Gottlieb', u'email': u'daniel.gottlieb@10gen.com'}

Message: SERVER-23976: Input validate repair database for casing
Branch: master
https://github.com/mongodb/mongo/commit/8edf38be766da31a778b3a8c24d90d45433957e4

Comment by Githook User [ 18/Nov/16 ]

Author:

{u'username': u'GeertBosch', u'name': u'Geert Bosch', u'email': u'geert@mongodb.com'}

Message: Revert "SERVER-23976: Input validate repair database for casing"

This reverts commit 512f655b5b4d3fd713a035633b6e857e85db8e7b.
Branch: master
https://github.com/mongodb/mongo/commit/33869b6b9a2155fad7f53531f85f2ce79b46a489

Comment by Githook User [ 18/Nov/16 ]

Author:

{u'username': u'dgottlieb', u'name': u'Daniel Gottlieb', u'email': u'daniel.gottlieb@10gen.com'}

Message: SERVER-23976: Input validate repair database for casing
Branch: master
https://github.com/mongodb/mongo/commit/512f655b5b4d3fd713a035633b6e857e85db8e7b

Comment by Max Hirschhorn [ 04/Nov/16 ]

Re-opening because the commit was reverted.

Comment by Githook User [ 04/Nov/16 ]

Author:

{u'username': u'monkey101', u'name': u'Dan Pasette', u'email': u'dan@mongodb.com'}

Message: Revert "SERVER-23976: Input validate database names for repairDatabase."

This reverts commit 69373e54608616c99905d5135bfd635367606ad2.

Conflicts:
jstests/core/repair_database_input_validation.js
Branch: master
https://github.com/mongodb/mongo/commit/46946554b53df298ac8ef5b08c4051c5308e4a18

Comment by Githook User [ 03/Nov/16 ]

Author:

{u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}

Message: SERVER-23976 Fix eslint
Branch: master
https://github.com/mongodb/mongo/commit/09e2e04e82966898368a6df2e2d6cf0e68bc257b

Comment by Githook User [ 03/Nov/16 ]

Author:

{u'username': u'jbreams', u'name': u'Jonathan Reams', u'email': u'jbreams@mongodb.com'}

Message: SERVER-23976 SERVER-26812 fix clang format
Branch: master
https://github.com/mongodb/mongo/commit/3d0f477cb2466a386a4f1fe5d020f4801f79ef78

Comment by Githook User [ 03/Nov/16 ]

Author:

{u'username': u'dgottlieb', u'name': u'Daniel Gottlieb', u'email': u'daniel.gottlieb@10gen.com'}

Message: SERVER-23976: Input validate database names for repairDatabase.
Branch: master
https://github.com/mongodb/mongo/commit/69373e54608616c99905d5135bfd635367606ad2

Comment by Eric Milkie [ 25/Oct/16 ]

The issue is that the repair database command doesn't check to see if the database exists first, before repairing. This amusingly results in different behavior on WiredTiger versus mmap, if you give it a database that doesn't exist (and also doesn't conflict in case with other existing databases).

Generated at Thu Feb 08 04:05:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.