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

failNonIntentLocksIfWaitNeeded failpoint doesn't handle renames across databases

    XMLWordPrintableJSON

Details

    • Fully Compatible
    • ALL
    • Hide

      python buildscripts/resmoke.py --suites=replica_sets jstests/replsets/ddl_ops_after_prepare_lock_failpoint.js
      

      diff --git a/jstests/replsets/ddl_ops_after_prepare_lock_failpoint.js b/jstests/replsets/ddl_ops_after_prepare_lock_failpoint.js
      index 22d40dad5d..95eea3f183 100644
      --- a/jstests/replsets/ddl_ops_after_prepare_lock_failpoint.js
      +++ b/jstests/replsets/ddl_ops_after_prepare_lock_failpoint.js
      @@ -74,6 +74,12 @@
               assert(testDB.getCollectionNames().includes(collToRenameFrom));
               assert(!testDB.getCollectionNames().includes(collToRenameTo));
       
      +        assert.commandFailedWithCode(testDB.adminCommand({
      +            renameCollection: testDB.getCollection(collToRenameFrom).getFullName(),
      +            to: testDB.getSiblingDB('test2').getCollection(collToRenameTo).getFullName(),
      +        }),
      +                                     ErrorCodes.LockTimeout);
      +
               // Attempt to add a new index to that collection.
               assert.commandFailedWithCode(
                   testDB.runCommand(
      

      Show
      python buildscripts/resmoke.py --suites=replica_sets jstests/replsets/ddl_ops_after_prepare_lock_failpoint.js diff --git a/jstests/replsets/ddl_ops_after_prepare_lock_failpoint.js b/jstests/replsets/ddl_ops_after_prepare_lock_failpoint.js index 22d40dad5d..95eea3f183 100644 --- a/jstests/replsets/ddl_ops_after_prepare_lock_failpoint.js +++ b/jstests/replsets/ddl_ops_after_prepare_lock_failpoint.js @@ -74,6 +74,12 @@ assert(testDB.getCollectionNames().includes(collToRenameFrom)); assert(!testDB.getCollectionNames().includes(collToRenameTo));   + assert.commandFailedWithCode(testDB.adminCommand({ + renameCollection: testDB.getCollection(collToRenameFrom).getFullName(), + to: testDB.getSiblingDB('test2').getCollection(collToRenameTo).getFullName(), + }), + ErrorCodes.LockTimeout); + // Attempt to add a new index to that collection. assert.commandFailedWithCode( testDB.runCommand(
    • STM 2019-03-25

    Description

      Renaming a collection across databases requires the global X lock. The logic which was added to LockerImpl::lock() as part of SERVER-39154 needs to be added to the LockerImpl::_lockGlobalBegin() function as well.

      Attachments

        Issue Links

          Activity

            People

              max.hirschhorn@mongodb.com Max Hirschhorn
              max.hirschhorn@mongodb.com Max Hirschhorn
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: