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

Triggering an exception in BtreeKeyGeneratorV1::getKeysImpl() prevents an index from ever becoming multikey

    • Fully Compatible
    • ALL
    • Hide
      python buildscripts/resmoke.py repro_server33106.js --storageEngine=wiredTiger
      
      repro_server33106.js
      (function() {
          const coll = db.mycoll;
          assert.commandWorked(coll.createIndex({a: 1, b: 1}));
          assert.commandWorked(coll.createIndex({'a.0.0': 1}));
          assert.commandFailedWithCode(coll.insert({a: [[1], {'0': 1}]}), 16746);
          assert.commandWorked(coll.insert({a: [{'1': 'green'}, 4]}));
      
          // The "multiKeyPaths" field reports the "a" field as causing the index to be multikey; however,
          // the "isMultiKey" field is false.
          printjson(coll.find().hint({a: 1, b: 1}).explain());
      
          const res = assert.commandWorked(coll.validate({full: true}));
          assert(res.valid, tojson(res));
      })();
      
      Show
      python buildscripts/resmoke.py repro_server33106.js --storageEngine=wiredTiger repro_server33106.js ( function () { const coll = db.mycoll; assert.commandWorked(coll.createIndex({a: 1, b: 1})); assert.commandWorked(coll.createIndex({ 'a.0.0' : 1})); assert.commandFailedWithCode(coll.insert({a: [[1], { '0' : 1}]}), 16746); assert.commandWorked(coll.insert({a: [{ '1' : 'green' }, 4]})); // The "multiKeyPaths" field reports the "a" field as causing the index to be multikey; however, // the "isMultiKey" field is false . printjson(coll.find().hint({a: 1, b: 1}).explain()); const res = assert.commandWorked(coll.validate({full: true })); assert(res.valid, tojson(res)); })();
    • Repl 2018-02-12
    • 0

      This issue was introduced by the changes from b2a7398 as part of SERVER-32206 and therefore only affects the master branch. CC judah.schvimer, daniel.gottlieb

      It appears that IndexCatalogEntryImpl::_isMultikey isn't getting set to true after the set of multikey paths are updated; however, I haven't been able to determine how that is connected to an earlier failed operation.

      opCtx->recoveryUnit()->onCommit([this] { _isMultikey.store(true); });
      

            Assignee:
            kyle.suarez@mongodb.com Kyle Suarez
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: