[SERVER-14643] Reason for query failure due to --notablescan should be included in log messages Created: 21/Jul/14  Updated: 11/Nov/19  Resolved: 11/Nov/19

Status: Closed
Project: Core Server
Component/s: Logging, Querying
Affects Version/s: 2.6.0
Fix Version/s: 4.3.1

Type: Improvement Priority: Minor - P4
Reporter: Daniel Pasette (Inactive) Assignee: David Percy
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Query 2019-11-04, Query 2019-11-18
Participants:

 Description   

When a query fails due to running mongod with --notablescan, the log message should indicate that the query failure was due to running with --notablescan.

Setup:

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

1) A normal find against a missing index will report which attribute is being queried, but not that it is failing due to --notablescan:

Prior to 2.6, this was logged:

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

After 2.6:

> db.a.find({attr:1})
Error: error: {
	"$err" : "Unable to execute query: error processing query: ns=notablescan.a limit=0 skip=0\nTree: attr == 1.0\nSort: {}\nProj: {}\n No query solutions",
	"code" : 17007
}

This impacts all clients of the query system: distinct, m/r, agg, count, etc.



 Comments   
Comment by Githook User [ 11/Nov/19 ]

Author:

{'username': 'dpercy', 'email': 'david.percy@mongodb.com', 'name': 'David Percy'}

Message: SERVER-14643 Return informative Status from QueryPlanner::plan
Branch: master
https://github.com/mongodb/mongo/commit/2411853a626e2c28e8bc54c82490cbb2ab9947a0

Comment by Asya Kamsky [ 27/Feb/19 ]

Would like to nominate for quick win candidate.

Comment by Asya Kamsky [ 27/Feb/19 ]

A charts user just ran into this - charts just runs agg with $limit:20 to sample some documents to get their fields.

Very cryptic error message and hard to find.

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