[SERVER-30934] dbCheck command causes server to crash if database for collection it is processing gets dropped Created: 03/Sep/17  Updated: 30/Oct/23  Resolved: 08/Sep/17

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 3.5.13

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Louis Williams
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

python buildscripts/resmoke.py repro_server30934.js

repro_server30934.js

(function() {
    "use strict";
 
    while (true) {
        assert.commandWorked(db.runCommand({create: "mycoll"}));
        assert.commandWorked(db.runCommand({dbCheck: "mycoll"}));
        assert.commandWorked(db.runCommand({dropDatabase: 1}));
    }
})();

Sprint: Storage 2017-09-11, Storage 2017-10-02
Participants:
Linked BF Score: 0

 Description   

DbCheckJob::_getCollectionMetadata() should check whether AutoGetDbForDbCheck::getDb() returns a null pointer in addition to checking whether Database::getCollection() returns a null pointer.

auto collection = agd.getDb()->getCollection(opCtx, info.nss);
 
if (!collection) {
    return false;
}



 Comments   
Comment by Ramon Fernandez Marina [ 08/Sep/17 ]

Author:

{'username': u'louiswilliams', 'name': u'Louis Williams', 'email': u'louis.williams@mongodb.com'}

Message:SERVER-30934 Check if DB is null before getting collection
Branch:master
https://github.com/mongodb/mongo/commit/d5babd4bf91055fa635deda2b9052cfa5ee2c2fc

Comment by Louis Williams [ 08/Sep/17 ]

Github commit: https://github.com/mongodb/mongo/commit/d5babd4bf91055fa635deda2b9052cfa5ee2c2fc

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