[SERVER-40038] failNonIntentLocksIfWaitNeeded failpoint doesn't handle renames across databases Created: 08/Mar/19  Updated: 29/Oct/23  Resolved: 08/Mar/19

Status: Closed
Project: Core Server
Component/s: Concurrency, Testing Infrastructure
Affects Version/s: None
Fix Version/s: 4.1.9

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

Issue Links:
Depends
Related
is related to SERVER-39154 Create a fail point to make it so if... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

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(

Sprint: STM 2019-03-25
Participants:

 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.



 Comments   
Comment by Githook User [ 08/Mar/19 ]

Author:

{'name': 'Max Hirschhorn', 'username': 'visemet', 'email': 'max.hirschhorn@mongodb.com'}

Message: SERVER-40038 Handle renames across databases in lock failpoint.
Branch: master
https://github.com/mongodb/mongo/commit/a7b2f629d51d8516e35136c8119f4382b981460c

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