[SERVER-14694] "create" command immediately after dropping database triggers assertion in ExtentManager::_getOpenFile() Created: 25/Jul/14  Updated: 22/May/15  Resolved: 22/May/15

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 2.6.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: J Rassi Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Operating System: ALL
Participants:

 Description   

Running the "dropDatabase" command immediately followed by the "create" command can trigger assertion "n >= 0 && n < static_cast<int>(_files.size())" in ExtentManager::_getOpenFile(). See the following log snippet generated from 2.6.1:

2014-07-16T07:22:16.910Z [conn36] dropDatabase DATABASE starting
2014-07-16T07:22:17.102Z [conn36] removeJournalFiles
2014-07-16T07:22:17.104Z [conn36] dropDatabase DATABASE finished
2014-07-16T07:22:17.104Z [conn36] command DATABASE.$cmd command: dropDatabase { dropDatabase: 1 } ntoreturn:1 keyUpdates:0 numYields:0 locks(micros) W:194530 reslen:114 194ms
2014-07-16T07:22:17.425Z [FileAllocator] allocating new datafile DATABASE.ns, filling with zeroes...
2014-07-16T07:22:17.456Z [FileAllocator] done allocating datafile DATABASE.ns, size: 16MB,  took 0.03 secs
2014-07-16T07:22:17.825Z [conn36] uh oh: 0
2014-07-16T07:22:17.825Z [conn36] DATABASE Assertion failure n >= 0 && n < static_cast<int>(_files.size()) src/mongo/db/storage/extent_manager.cpp 109
2014-07-16T07:22:17.833Z [conn36] DATABASE 0x1006ac7ab 0x1006642c2 0x100654d52 0x1004cf4bf 0x1004d0790 0x1004f308c 0x1004f3950 0x1004f8f58 0x1004f8c38 0x1000dd082 0x1000de4d9 0x1000e609d 0x1000e5937 0x100320e4b 0x1001bd05d 0x1001b7605 0x1001b8375 0x1001b907c 0x1003cfc7f 0x1002a1050
 0   mongod                              0x00000001006ac7ab _ZN5mongo15printStackTraceERSo + 43
 1   mongod                              0x00000001006642c2 _ZN5mongo10logContextEPKc + 114
 2   mongod                              0x0000000100654d52 _ZN5mongo12verifyFailedEPKcS1_j + 274
 3   mongod                              0x00000001004cf4bf _ZNK5mongo13ExtentManager12_getOpenFileEi + 253
 4   mongod                              0x00000001004d0790 _ZNK5mongo13ExtentManager9recordForERKNS_7DiskLocE + 24
 5   mongod                              0x00000001004f308c _ZN5mongo16NamespaceDetails10__stdAllocEib + 362
 6   mongod                              0x00000001004f3950 _ZN5mongo16NamespaceDetails5allocEPNS_10CollectionERKNS_10StringDataEi + 86
 7   mongod                              0x00000001004f8f58 _ZN5mongo19SimpleRecordStoreV111allocRecordEii + 106
 8   mongod                              0x00000001004f8c38 _ZN5mongo17RecordStoreV1Base12insertRecordEPKcii + 76
 9   mongod                              0x00000001000dd082 _ZN5mongo10Collection15_insertDocumentERKNS_7BSONObjEbPKNS_16PregeneratedKeysE + 120
 10  mongod                              0x00000001000de4d9 _ZN5mongo10Collection14insertDocumentERKNS_7BSONObjEbPKNS_16PregeneratedKeysE + 525
 11  mongod                              0x00000001000e609d _ZN5mongo8Database22_addNamespaceToCatalogERKNS_10StringDataEPKNS_7BSONObjE + 959
 12  mongod                              0x00000001000e5937 _ZN5mongo8Database16createCollectionERKNS_10StringDataERKNS_17CollectionOptionsEbb + 1335
 13  mongod                              0x0000000100320e4b _ZN5mongo12userCreateNSEPKcNS_7BSONObjERSsbb + 1083
 14  mongod                              0x00000001001bd05d _ZN5mongo9CmdCreate3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 1243
 15  mongod                              0x00000001001b7605 _ZN5mongo12_execCommandEPNS_7CommandERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 37
 16  mongod                              0x00000001001b8375 _ZN5mongo7Command11execCommandEPS0_RNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb + 2873
 17  mongod                              0x00000001001b907c _ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 1388
 18  mongod                              0x00000001003cfc7f _ZN5mongo11newRunQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_ + 1615
 19  mongod                              0x00000001002a1050 _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE + 1968
2014-07-16T07:22:17.833Z [conn36] command DATABASE.$cmd command: create { create: "c" } ntoreturn:1 keyUpdates:0 numYields:0 locks(micros) w:408276 reslen:124 408ms



 Comments   
Comment by Geert Bosch [ 22/May/15 ]

This code was rewritten during the 3.0 cycle and does no longer exhibit the behavior.

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