Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-24986

Collection validation fails when a partial geo index is present

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.11
    • Affects Version/s: 3.3.6
    • Component/s: Storage
    • Labels:
      None
    • Fully Compatible
    • ALL
    • TIG 17 (07/15/16), TIG 18 (08/05/16)
    • 0

      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
      }
      

            Assignee:
            robert.guo@mongodb.com Robert Guo (Inactive)
            Reporter:
            kamran.khan Kamran K.
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: