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

Parallel arrays in distinct sub-documents no longer cause an indexing error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.7.2
    • Component/s: Indexing
    • Labels:
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      var myDB = db.getSiblingDB('btree');
      myDB.dropDatabase();
       
      myDB.foo.ensureIndex({'a.a': 1, 'b.a': 1});
      myDB.foo.insert({a: {a: [1]}, b: {a: [1]}});

      Show
      var myDB = db.getSiblingDB('btree'); myDB.dropDatabase();   myDB.foo.ensureIndex({'a.a': 1, 'b.a': 1}); myDB.foo.insert({a: {a: [1]}, b: {a: [1]}});

      Description

      This bug appears to be a regression from SERVER-8192. In 2.6.1, documents that contain parallel arrays in distinct sub-documents are not allowed to be inserted when a corresponding index is present:

      2.6.1:

      > var myDB = db.getSiblingDB('btree');
      > myDB.dropDatabase();
      { "dropped" : "btree", "ok" : 1 }
       
      > myDB.foo.ensureIndex({'a.a': 1, 'b.a': 1});
      {
      	"createdCollectionAutomatically" : true,
      	"numIndexesBefore" : 1,
      	"numIndexesAfter" : 2,
      	"ok" : 1
      }
      > myDB.foo.insert({a: {a: [1]}, b: {a: [1]}});
      WriteResult({
      	"nInserted" : 0,
      	"writeError" : {
      		"code" : 10088,
      		"errmsg" : "insertDocument :: caused by :: 10088 cannot index parallel arrays [a] [a]"
      	}
      })

      2.6.2-pre w/ SERVER-8192 patch:

      > var myDB = db.getSiblingDB('btree');
      > myDB.dropDatabase();
      { "dropped" : "btree", "ok" : 1 }
       
      > myDB.foo.ensureIndex({'a.a': 1, 'b.a': 1});
      {
      	"createdCollectionAutomatically" : true,
      	"numIndexesBefore" : 1,
      	"numIndexesAfter" : 2,
      	"ok" : 1
      }
      > myDB.foo.insert({a: {a: [1]}, b: {a: [1]}});
      WriteResult({ "nInserted" : 1 })

      master:

      > var myDB = db.getSiblingDB('btree');
      > myDB.dropDatabase();
      { "dropped" : "btree", "ok" : 1 }
       
      > myDB.foo.ensureIndex({'a.a': 1, 'b.a': 1});
      {
      	"createdCollectionAutomatically" : true,
      	"numIndexesBefore" : 1,
      	"numIndexesAfter" : 2,
      	"ok" : 1
      }
      > myDB.foo.insert({a: {a: [1]}, b: {a: [1]}});
      WriteResult({ "nInserted" : 1 })


      Version: 9c3edc610c7f52a3d502fbc50e0acc55b5efa645

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: