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

failNonIntentLocksIfWaitNeeded failpoint doesn't handle renames across databases

    • Fully Compatible
    • ALL
    • Hide
      python buildscripts/resmoke.py --suites=replica_sets jstests/replsets/ddl_ops_after_prepare_lock_failpoint.js
      
      Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      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 Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml 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

      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.

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

              Created:
              Updated:
              Resolved: