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

dropDatabase does not respect maxTimeMS

    • Fully Compatible
    • ALL
    • Hide
      (function() {
          const rst = ReplSetTest({nodes: 1});
          rst.startSet();
          rst.initiate();    
      
          const testDB = rst.getPrimary().getDB("test");
          const session = testDB.getMongo().startSession({causalConsistency: false});
          const sessionDB = session.getDatabase("test");
          assert.commandWorked(sessionDB.c.insert({}));    
      
          session.startTransaction();
          assert.commandWorked(sessionDB.c.insert({}));    
      
          // Runs forever.
          assert.commandFailedWithCode(testDB.runCommand({dropDatabase: 1, maxTimeMS: 100}), ErrorCodes.ExceededTimeLimit);    
      
          session.commitTransaction();
          session.endSession();
          rst.stopSet();
      }()); 
      Show
      (function() { const rst = ReplSetTest({nodes: 1}); rst.startSet(); rst.initiate(); const testDB = rst.getPrimary().getDB( "test" ); const session = testDB.getMongo().startSession({causalConsistency: false }); const sessionDB = session.getDatabase( "test" ); assert .commandWorked(sessionDB.c.insert({})); session.startTransaction(); assert .commandWorked(sessionDB.c.insert({})); // Runs forever. assert .commandFailedWithCode(testDB.runCommand({dropDatabase: 1, maxTimeMS: 100}), ErrorCodes.ExceededTimeLimit); session.commitTransaction(); session.endSession(); rst.stopSet(); }());
    • Storage NYC 2018-12-17

      If dropDatabase is blocked from acquiring a GlobalWrite lock, it will wait forever, even if maxTimeMS is set.

            Assignee:
            xiangyu.yao@mongodb.com Xiangyu Yao (Inactive)
            Reporter:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: