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

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      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)); })();
    • Sprint:
      Repl 2018-02-12
    • Linked BF Score:
      0

      Description

      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); });
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: