[SERVER-33106] Triggering an exception in BtreeKeyGeneratorV1::getKeysImpl() prevents an index from ever becoming multikey Created: 03/Feb/18  Updated: 29/Oct/23  Resolved: 08/Feb/18

Status: Closed
Project: Core Server
Component/s: Index Maintenance, Storage
Affects Version/s: None
Fix Version/s: 3.7.2

Type: Bug Priority: Critical - P2
Reporter: Max Hirschhorn Assignee: Kyle Suarez
Resolution: Fixed Votes: 0
Labels: rollback-functional
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Problem/Incident
is caused by SERVER-32206 Catalog change to declare an index as... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

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



 Comments   
Comment by Githook User [ 08/Feb/18 ]

Author:

{'email': 'kyle.suarez@mongodb.com', 'name': 'Kyle Suarez', 'username': 'ksuarz'}

Message: SERVER-33106 set multiKeyPaths and clear plan cache in onCommit hook

Without this change, if the WriteUnitOfWork aborts, we will set the
multiKeyPaths for the index without actually marking it as multiKey.
Branch: master
https://github.com/mongodb/mongo/commit/8d46e50bdf3e52c39fe60ed3323fe732a84412f8

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