[SERVER-24986] Collection validation fails when a partial geo index is present Created: 11/Jul/16  Updated: 13/Aug/16  Resolved: 19/Jul/16

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 3.3.6
Fix Version/s: 3.3.11

Type: Bug Priority: Major - P3
Reporter: Kamran K. Assignee: Robert Guo (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: TIG 17 (07/15/16), TIG 18 (08/05/16)
Participants:
Linked BF Score: 0

 Description   

This validation failure does not occur in 3.2.7. It was introduced in 3.3.6 and seems indicative of a validate() bug rather than a dataloss issue.

Repro script:

'use strict';
 
var coll = db.geo_partial;
coll.drop();
 
coll.insert({x: 1});
coll.ensureIndex({x: '2dsphere'}, {partialFilterExpression: {a: {$eq: 1}}});
 
coll.validate(true);

Validate output:

{
	"ns" : "test.geo_partial",
	"valid" : false,
	"warnings" : [ ],
	"errors" : [
		"exception during index validation: 16755 Can't extract geo keys: { _id: ObjectId('5783dbe528816e25ea30fe08'), x: 1.0 }  geo element must be an array or object: x: 1.0"
	],
	"advice" : "A corrupt namespace has been detected. See http://dochub.mongodb.org/core/data-recovery for recovery steps.",
	"ok" : 1
}



 Comments   
Comment by Githook User [ 19/Jul/16 ]

Author:

{u'username': u'guoyr', u'name': u'Robert Guo', u'email': u'robertguo@me.com'}

Message: SERVER-24986 validate() should work with partial indexes and invalid documents
Branch: master
https://github.com/mongodb/mongo/commit/24e532df604618c104f39cbff5a3de3a34c607bb

Generated at Thu Feb 08 04:07:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.