[SERVER-14636] Aggregation explain on uncached plan returns error "No plan available to provide stats" Created: 21/Jul/14  Updated: 11/Jul/16  Resolved: 01/Dec/14

Status: Closed
Project: Core Server
Component/s: Aggregation Framework, Diagnostics, Querying
Affects Version/s: 2.6.3
Fix Version/s: 2.7.1

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

Issue Links:
Depends
Duplicate
Related
Tested
Operating System: ALL
Participants:

 Description   

Running explain on an aggregation pipeline returns the error "No plan available to provide stats" if the query issued by the $cursor stage is not cached and has multiple candidate plans.

Reproduces on 2.6.0 through 2.6.3. Does not reproduce on master.

> db.foo.drop()
true
> db.foo.ensureIndex({a:1})
{
	"createdCollectionAutomatically" : true,
	"numIndexesBefore" : 1,
	"numIndexesAfter" : 2,
	"ok" : 1
}
> db.foo.ensureIndex({b:1})
{
	"createdCollectionAutomatically" : false,
	"numIndexesBefore" : 2,
	"numIndexesAfter" : 3,
	"ok" : 1
}
> db.foo.insert({a:1,b:2})
WriteResult({ "nInserted" : 1 })
> db.foo.insert({a:1,b:2})
WriteResult({ "nInserted" : 1 })
> db.foo.insert({a:1,b:2})
WriteResult({ "nInserted" : 1 })
> db.foo.aggregate([{$match: {a:1,b:1}}],{explain:true})
{
	"stages" : [
		{
			"$cursor" : {
				"query" : {
					"a" : 1,
					"b" : 1
				},
				"planError" : "InternalError No plan available to provide stats"
			}
		}
	],
	"ok" : 1
}
>

Originally reported on mongodb-user: <https://groups.google.com/forum/#!topic/mongodb-user/TwK0wKr45Bk>.



 Comments   
Comment by Stennie Steneker (Inactive) [ 05/Jan/15 ]

There have been a few comments on this issue still being present in MongoDB 2.6.x. As per the current issue metadata, the fixVersion is 2.7.1 (i.e. fixed in the 2.7.x development series which will culminate in the 2.8.0 production release). A backport has been requested for MongoDB 2.6, but has not been approved yet.

You can watch this issue for updates. Once the feasibility of a backport has been reviewed, the backport status should change to either "Approved" or "Cannot". If Approved, the backport status will eventually change to Completed with a 2.6.x fixVersion added.

Regards,
Stephen

Comment by Dave Mackintosh [ 30/Dec/14 ]

Still an issue in 2.6.3 (db and shell) deployed with Google Compute 1 Click Deploy.

cat /etc/*release
PRETTY_NAME="Debian GNU/Linux 7 (wheezy)"
NAME="Debian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="http://bugs.debian.org/"

Also in 2.6.6 installed via brew on OSx Yosemite 10.10.1 (14B25)

Comment by Juan Manuel Diego G [ 28/Nov/14 ]

Still in 2.6.5

Comment by Veena Chugani [ 02/Oct/14 ]

yes I am still facing the issue in 2.6.4 also?

Comment by Cody Wilson [ 22/Sep/14 ]

This is still an issue on 2.6.4.

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