[SERVER-24563] Secondary crash when inserting document into db with different case Created: 14/Jun/16  Updated: 05/Apr/17  Resolved: 18/Nov/16

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: 3.3.8
Fix Version/s: 3.2.12, 3.4.2, 3.5.1

Type: Bug Priority: Major - P3
Reporter: Isabella Siu (Inactive) Assignee: Geert Bosch
Resolution: Done Votes: 0
Labels: bkp
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-12930 More than one lock exists per logical... Closed
is depended on by SERVER-25411 run jstestfuzz_concurrent* on mmapv1 Closed
Related
related to SERVER-23976 repairDatabase command on a new, diff... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.4, v3.2
Sprint: Storage 2016-11-21, Storage 2016-12-12
Participants:
Linked BF Score: 0

 Description   

When different threads are inserting into databases with the same name in different cases the secondary crashes

d20001| 2016-06-14T13:25:25.593-0400 I STORAGE  [FileAllocator] allocating new datafile /data/db/testReplSet-1/dbcasetest_dbnameA.0, filling with zeroes...
d20001| 2016-06-14T13:25:25.607-0400 I STORAGE  [FileAllocator] done allocating datafile /data/db/testReplSet-1/dbcasetest_dbnameA.0, size: 16MB,  took 0.013 secs
d20001| 2016-06-14T13:25:25.641-0400 E REPL     [repl writer worker 9] Failed command { create: "bar" } on dbcasetest_dbnamea with status DatabaseDifferCase: db already exists with different case already have: [dbcasetest_dbnameA] trying to create [dbcasetest_dbnamea] during oplog application
d20001| 2016-06-14T13:25:25.641-0400 F REPL     [repl writer worker 9] Error applying operation ({ ts: Timestamp 1465925123000|7, t: 1, h: 6109000168575080191, v: 2, op: "c", ns: "dbcasetest_dbnamea.$cmd", o: { create: "bar" } }): DatabaseDifferCase: db already exists with different case already have: [dbcasetest_dbnameA] trying to create [dbcasetest_dbnamea]
d20001| 2016-06-14T13:25:25.641-0400 I -        [repl writer worker 9] Fatal assertion 16359 DatabaseDifferCase: db already exists with different case already have: [dbcasetest_dbnameA] trying to create [dbcasetest_dbnamea]
d20001| 2016-06-14T13:25:25.642-0400 I -        [repl writer worker 9] 
d20001| 
d20001| ***aborting after fassert() failure
d20001| 



 Comments   
Comment by Githook User [ 13/Jan/17 ]

Author:

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

Message: SERVER-24563: Add create_database FSM test to sharded SCCC blacklist
Branch: v3.2
https://github.com/mongodb/mongo/commit/0c568d25c5e23401ec040f2d16501c0047c3d202

Comment by Githook User [ 13/Jan/17 ]

Author:

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

Message: SERVER-24563 Fix race in check for DB names that differ in case only

(cherry picked from commit dceaf6bf28fb879eb23f3c022647ee3e8f15c370)

Modifications for backport:
src/mongo/db/catalog/database_holder.h
src/mongo/db/catalog/database_holder.cpp
jstests/concurrency/fsm_all_sharded_replication.js
jstests/concurrency/fsm_all_sharded_replication_with_balancer.js
jstests/concurrency/fsm_workloads/create_database.js
Branch: v3.2
https://github.com/mongodb/mongo/commit/5a4686591b4d7b4f85cf87a913b6f17ae5941ce5

Comment by Githook User [ 11/Jan/17 ]

Author:

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

Message: Revert "SERVER-24563 Fix race in check for DB names that differ in case only"

This reverts commit d75f8c7cf92fcf4c6089e27ff548d0ed1fccb1a0.
Branch: v3.2
https://github.com/mongodb/mongo/commit/fab6cb2a7e2574b1da68037753a64618eab84dd9

Comment by Githook User [ 11/Jan/17 ]

Author:

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

Message: SERVER-24563 Fix race in check for DB names that differ in case only

(cherry picked from commit dceaf6bf28fb879eb23f3c022647ee3e8f15c370)

Modifications for backport:
src/mongo/db/catalog/database_holder.h
src/mongo/db/catalog/database_holder.cpp
Branch: v3.2
https://github.com/mongodb/mongo/commit/d75f8c7cf92fcf4c6089e27ff548d0ed1fccb1a0

Comment by Githook User [ 11/Jan/17 ]

Author:

{u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'redbeard0531@gmail.com'}

Message: Revert "SERVER-24563 Fix race in check for DB names that differ in case only"

This reverts commit e262daabeabaa00885c2aaecf22ace0255724008.
Branch: v3.2
https://github.com/mongodb/mongo/commit/53d47e44005bdebeb5bea56e3f62d61d7d754502

Comment by Githook User [ 11/Jan/17 ]

Author:

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

Message: SERVER-24563 Fix race in check for DB names that differ in case only

(cherry picked from commit dceaf6bf28fb879eb23f3c022647ee3e8f15c370)

Modifications for backport:
src/mongo/db/catalog/database_holder.h
src/mongo/db/catalog/database_holder.cpp
Branch: v3.2
https://github.com/mongodb/mongo/commit/e262daabeabaa00885c2aaecf22ace0255724008

Comment by Githook User [ 09/Jan/17 ]

Author:

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

Message: SERVER-24563 Fix race in check for DB names that differ in case only
Branch: v3.4
https://github.com/mongodb/mongo/commit/d2cf1646f7e4b1602ad1de16a6ae6fde5cd19950

Comment by Githook User [ 18/Nov/16 ]

Author:

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

Message: SERVER-24563 Fix race in check for DB names that differ in case only
Branch: master
https://github.com/mongodb/mongo/commit/27071b2f3e476737f0f86b07ae997617748f6848

Comment by Eric Milkie [ 26/Oct/16 ]

I believe this means you could successfully create two databases that only differ by case, and insert data into both. But new clients would have trouble accessing either one – in addition to the crash you would experience on secondaries of a replica set.

Comment by Eric Milkie [ 26/Oct/16 ]

There is a race when checking for duplicate database names that only vary by case. We don't hold the lock between checking for a duplicate and adding the new database to the list.
We should fix the race in DatabaseHolder::openDb().

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