ns name too long in 2.1.2

105 views
Skip to first unread message

Alex

unread,
Jul 3, 2012, 11:59:00 AM7/3/12
to mongod...@googlegroups.com
Hi all, 
  I'm getting the error "ns name too long in 2.1.2". My db name is 17 chars long, my source collection name is another 15 , the target collection name is again 17 and the job runs every 3 minutes.

The offending line in mongo java driver code is:
MapReduceOutput mro = datastore.getDB().getCollection("15charscollection").mapReduce(map, reduce, "17charscollectionname", MapReduceCommand.OutputType.REDUCE, queryToLimitMapReduceDocuments() );


Tue Jul  3 15:39:20 [conn42256] mr failed, removing collection :: caused by :: 10080 ns name too long, max size is 128 

If I change the "17charscollectionname" to something like "resps" then everything is fine, but this is obviously not a permanent solution.

There was a defect Server-3108 referring to this error. The solution back then was naming the temp collection as "tmp.mr." + srcCollection + "_" + increment" . 
Could that be a regression issue for 2.1.2 ?

A. Jesse Jiryu Davis

unread,
Jul 5, 2012, 11:38:52 AM7/5/12
to mongod...@googlegroups.com
Hi, I can't reproduce your error on the shell. A 15-character DB name and 17-character collection name don't provoke an error for me in 2.1.2:

> use db345678901234567 // 17 char DB name
> db.collection12345.insert({a:1}) // 15 char collection name
> db.collection12345.insert({a:2})
> map = function() { emit('a', this); }
> reduce = function(key, values) { var result=0; values.forEach(function(value) { result += value.a; }); return value; }
> db.runCommand({mapreduce: 'collection12345', map: map, reduce:reduce, out: {reduce: 'collection12345'}, query:{} });
{
"result" : "collection12345",
"timeMillis" : 4,
"counts" : {
"input" : 3,
"emit" : 3,
"reduce" : 1,
"output" : 3
},
"ok" : 1
}

Alex

unread,
Jul 6, 2012, 4:31:16 AM7/6/12
to mongod...@googlegroups.com
Indeed, your test case doesn't reproduce it in 2.1.2 or 2.1.0 . My first thought was that tmp.mr. + srcCollectionName  + increment >=128 but this would mean that increment has to be 106 chars ( 128 - (7+15) ) which sounds pretty much impossible...
I will try to reproduce in dev env and post back..
Reply all
Reply to author
Forward
0 new messages