-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.2.7, 2.8.0-rc0
-
Component/s: Concurrency
-
Storage Execution
-
ALL
Problem
The cloneCollection command calls the copyCollection method on the Cloner class
https://github.com/mongodb/mongo/blob/master/src/mongo/db/commands/clone_collection.cpp#L143
Cloner cloner; ... return cloner.copyCollection(txn, collection, query, errmsg, true, false, copyIndexes);
The Cloner class does the following
https://github.com/mongodb/mongo/blob/master/src/mongo/db/cloner.cpp#L113
// XXX: can probably take dblock instead
Lock::GlobalWrite lk(txn->lockState());
Solution
cloneCollection (since the source is a different server) probably only needs to take out a DB_X on the local (i.e. destination) server. However, all usages of should be checked in case the lock type has to be determined by the caller function (in this case cloneCollection)
- is related to
-
SERVER-36204 Deprecate cloneCollection command
- Closed