[SERVER-7793] Long index namespaces throw assertion on collection drop, due to "$extra" added Created: 29/Nov/12  Updated: 06/Dec/22  Resolved: 19/Jul/18

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 2.2.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Thomas Rueckstiess Assignee: Backlog - Query Team (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-12075 Index with specific name length will ... Closed
Related
is related to SERVER-1140 Support 64 (or more) indexes Closed
Assigned Teams:
Query
Operating System: ALL
Steps To Reproduce:

See description

Participants:

 Description   

> use this_here_must_be_a_very_long_database_name
switched to db this_here_must_be_a_very_long_database_name
> db.this_is_really_a_very_long_collection_name.ensureIndex({field: 1}, {name: 'this_is_a_very_long_index_name_indeed'})
> db.this_is_really_a_very_long_collection_name.drop()
true

Log file:

Thu Nov 29 12:55:16 [conn3] insert this_here_must_be_a_very_long_database_name.system.indexes keyUpdates:0 locks(micros) w:244859 244ms
Thu Nov 29 12:55:16 [FileAllocator] done allocating datafile /Users/tr/Documents/tickets/data/db/this_here_must_be_a_very_long_database_name.1, size: 128MB,  took 0.319 secs
Thu Nov 29 12:55:28 [conn3] CMD: drop this_here_must_be_a_very_long_database_name.this_is_really_a_very_long_collection_name
Thu Nov 29 12:55:28 [conn3] Assertion: 10348:$extra: ns name too long
0x103dc901b 0x103f85e90 0x103fa4eef 0x103f9fda4 0x103f5fbee 0x103ff9582 0x103ffd454 0x103f5fe39 0x103f49627 0x103f4299b 0x103f439f6 0x103f440f4 0x103bb844e 0x103bb8bdc 0x103c74305 0x103b7f302 0x103be957d 0x103c12f75 0x7fff8aa65742 0x7fff8aa52181 
 0   mongod                              0x0000000103dc901b _ZN5mongo15printStackTraceERSo + 43
 1   mongod                              0x0000000103f85e90 _ZN5mongo11msgassertedEiPKc + 176
 2   mongod                              0x0000000103fa4eef _ZNK5mongo9Namespace9extraNameEi + 151
 3   mongod                              0x0000000103f9fda4 _ZN5mongo14NamespaceIndex7kill_nsEPKc + 274
 4   mongod                              0x0000000103f5fbee _ZN5mongo6dropNSERKSs + 1246
 5   mongod                              0x0000000103ff9582 _ZN5mongo12IndexDetails8kill_idxEv + 120
 6   mongod                              0x0000000103ffd454 _ZN5mongo11dropIndexesEPNS_16NamespaceDetailsEPKcS3_RSsRNS_14BSONObjBuilderEb + 372
 7   mongod                              0x0000000103f5fe39 _ZN5mongo14dropCollectionERKSsRSsRNS_14BSONObjBuilderE + 201
 8   mongod                              0x0000000103f49627 _ZN5mongo7CmdDrop3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 397
 9   mongod                              0x0000000103f4299b _ZN5mongo12_execCommandEPNS_7CommandERKSsRNS_7BSONObjEiRNS_14BSONObjBuilderEb + 91
 10  mongod                              0x0000000103f439f6 _ZN5mongo11execCommandEPNS_7CommandERNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb + 2870
 11  mongod                              0x0000000103f440f4 _ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 1076
 12  mongod                              0x0000000103bb844e _ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 46
 13  mongod                              0x0000000103bb8bdc _ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_ + 1436
 14  mongod                              0x0000000103c74305 _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE + 1349
 15  mongod                              0x0000000103b7f302 _ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE + 206
 16  mongod                              0x0000000103be957d _ZN5mongo3pms9threadRunEPNS_13MessagingPortE + 1645
 17  mongod                              0x0000000103c12f75 thread_proxy + 229
 18  libsystem_c.dylib                   0x00007fff8aa65742 _pthread_start + 327
 19  libsystem_c.dylib                   0x00007fff8aa52181 thread_start + 13
Thu Nov 29 12:55:28 [conn3] Assertion: 10348:$extra: ns name too long
0x103dc901b 0x103f85e90 0x103fa4eef 0x103f9fda4 0x103f5fbee 0x103ff9582 0x103ffd454 0x103f5fe39 0x103f49627 0x103f4299b 0x103f439f6 0x103f440f4 0x103bb844e 0x103bb8bdc 0x103c74305 0x103b7f302 0x103be957d 0x103c12f75 0x7fff8aa65742 0x7fff8aa52181 
 0   mongod                              0x0000000103dc901b _ZN5mongo15printStackTraceERSo + 43
 1   mongod                              0x0000000103f85e90 _ZN5mongo11msgassertedEiPKc + 176
 2   mongod                              0x0000000103fa4eef _ZNK5mongo9Namespace9extraNameEi + 151
 3   mongod                              0x0000000103f9fda4 _ZN5mongo14NamespaceIndex7kill_nsEPKc + 274
 4   mongod                              0x0000000103f5fbee _ZN5mongo6dropNSERKSs + 1246
 5   mongod                              0x0000000103ff9582 _ZN5mongo12IndexDetails8kill_idxEv + 120
 6   mongod                              0x0000000103ffd454 _ZN5mongo11dropIndexesEPNS_16NamespaceDetailsEPKcS3_RSsRNS_14BSONObjBuilderEb + 372
 7   mongod                              0x0000000103f5fe39 _ZN5mongo14dropCollectionERKSsRSsRNS_14BSONObjBuilderE + 201
 8   mongod                              0x0000000103f49627 _ZN5mongo7CmdDrop3runERKSsRNS_7BSONObjEiRSsRNS_14BSONObjBuilderEb + 397
 9   mongod                              0x0000000103f4299b _ZN5mongo12_execCommandEPNS_7CommandERKSsRNS_7BSONObjEiRNS_14BSONObjBuilderEb + 91
 10  mongod                              0x0000000103f439f6 _ZN5mongo11execCommandEPNS_7CommandERNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb + 2870
 11  mongod                              0x0000000103f440f4 _ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 1076
 12  mongod                              0x0000000103bb844e _ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_11_BufBuilderINS_16TrivialAllocatorEEERNS_14BSONObjBuilderEbi + 46
 13  mongod                              0x0000000103bb8bdc _ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_ + 1436
 14  mongod                              0x0000000103c74305 _ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE + 1349
 15  mongod                              0x0000000103b7f302 _ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE + 206
 16  mongod                              0x0000000103be957d _ZN5mongo3pms9threadRunEPNS_13MessagingPortE + 1645
 17  mongod                              0x0000000103c12f75 thread_proxy + 229
 18  libsystem_c.dylib                   0x00007fff8aa65742 _pthread_start + 327
 19  libsystem_c.dylib                   0x00007fff8aa52181 thread_start + 13



 Comments   
Comment by Eric Milkie [ 19/Jul/18 ]

Doesn't seem to repro even in 3.6

Comment by Thomas Rueckstiess [ 29/Nov/12 ]

In namespace_details.cpp NameSpaceIndex::kill_ns we're calling NameSpace::extraName, which appends "$extra" to the string. This can increase the namespace length to > 128 characters and throw the assertion.

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