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

dbCheck command causes server to crash if database for collection it is processing gets dropped

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.13
    • Affects Version/s: None
    • Component/s: Storage
    • Fully Compatible
    • ALL
    • Hide
      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}));
          }
      })();
      
      Show
      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})); } })();
    • Storage 2017-09-11, Storage 2017-10-02
    • 0

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

            Assignee:
            louis.williams@mongodb.com Louis Williams
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: