[SERVER-6796] --notablescan doesn't report missing index for mapreduce (and to client in all cases) Created: 17/Aug/12  Updated: 10/Dec/14  Resolved: 21/Jul/14

Status: Closed
Project: Core Server
Component/s: MapReduce
Affects Version/s: 2.2.0-rc0
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Doug Hudson Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

> db.serverBuildInfo()
{
"version" : "2.2.0-rc0",
"gitVersion" : "33dc8445316479bbaa062db00f179fa5c39bbddb",
"sysInfo" : "Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49",
"versionArray" : [
2,
2,
0,
-10
],
"bits" : 64,
"debug" : false,
"maxBsonObjectSize" : 16777216,
"ok" : 1
}


Participants:

 Description   

Setup:

db.a.save({attr:1})

1) A normal find against a missing index will report which attribute is being queried (at least in server log):

> db.a.find({attr:1})
error: { "$err" : "table scans not allowed:tmp.a", "code" : 10111 }

Server log:

Fri Aug 17 15:44:21 [conn1] assertion 10111 table scans not allowed:tmp.a ns:tmp.a query:{ attr: 1.0 }

2) If the query given to map reduce misses an index the query attribute(s) are not reported on either side:

> db.a.mapReduce(function(){},function(){},{out:'mr_out',query:{attr:1}})
Fri Aug 17 15:44:34 uncaught exception: map reduce failed:{
        "errmsg" : "exception: table scans not allowed:tmp.a",
        "code" : 10111,
        "ok" : 0
}

Server log:

Fri Aug 17 15:44:34 [conn1] CMD: drop tmp.tmp.mr.a_75_inc
Fri Aug 17 15:44:34 [conn1] build index tmp.tmp.mr.a_75_inc { 0: 1 }
Fri Aug 17 15:44:34 [conn1] build index done.  scanned 0 total records. 0 secs
Fri Aug 17 15:44:34 [conn1] CMD: drop tmp.tmp.mr.a_75
Fri Aug 17 15:44:34 [conn1] build index tmp.tmp.mr.a_75 { _id: 1 }
Fri Aug 17 15:44:34 [conn1] build index done.  scanned 0 total records. 0.046 secs
Fri Aug 17 15:44:34 [conn1] mr failed, removing collection :: caused by :: 10111 table scans not allowed:tmp.a
Fri Aug 17 15:44:34 [conn1] CMD: drop tmp.tmp.mr.a_75
Fri Aug 17 15:44:34 [conn1] CMD: drop tmp.tmp.mr.a_75_inc

Issues:
1) Nowhere does it inform which attributes that are being queried when map reduce fails due to --notablescan, which can be hard to track down in complex, dynamic systems.

2) The error message returned from the server in BOTH cases doesn't include the query attributes, which would be very helpful when debugging. This I assume will apply for all client drivers (observed in js shell and ruby).



 Comments   
Comment by Daniel Pasette (Inactive) [ 21/Jul/14 ]

crudson, thanks for the report. The original issue reported against MongoDB 2.2 was that the query predicate was not reported when MapReduce caused a table scan when mongod was run with --notablescan. Due to changes in the query sub-system, the query predicate is logged now, but the reason the query fails (due to running with {{--notablescan}]) is obscured. I'm resolving this issue and have created a new ticket to address the new issue: SERVER-14643.

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