[SERVER-11418] cloneCollection ignores the copyindexes field Created: 28/Oct/13  Updated: 06/Dec/22  Resolved: 05/Jul/19

Status: Closed
Project: Core Server
Component/s: Admin
Affects Version/s: 2.2.6, 2.4.7, 2.5.3
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Backlog - Storage Execution Team
Resolution: Won't Do Votes: 0
Labels: neweng, query-44-grooming
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to DOCS-2157 Remove references to copyindexes argu... Closed
Assigned Teams:
Storage Execution
Operating System: ALL
Steps To Reproduce:

On ubuntu:11111:

> db.dropDatabase()
{ "dropped": "test", "ok": 1 }
> db.foo.insert({a:1})
> db.foo.ensureIndex({a:1})

On ubuntu:22222:

> db.dropDatabase()
{ "dropped": "test", "ok": 1 }
> db.runCommand({cloneCollection:'test.foo', from:'ubuntu:11111', copyindexes:false})
{ "ok": 1 }
> db.system.indexes.find()
{ "v": 1, "key": { "_id": 1 }, "ns": "test.foo", "name": "_id_" }
{ "v": 1, "key": { "a": 1 }, "ns": "test.foo", "name": "a_1" }
// Note the a_1 index was copied

Participants:

 Description   

If you run cloneCollection with copyindexes:false, the indexes are still copied. There is a message logged:

ERROR copy collection copyIndexes not implemented?  test.foo



 Comments   
Comment by Eric Milkie [ 05/Jul/19 ]

cloneCollection is now deprecated as of 4.2

Comment by David Storch [ 05/Jul/19 ]

milkie, does the execution team own the cloneCollection command? (I don't think this ticket belongs on the query team backlog, but I'm not sure where it should go.)

Comment by auto [ 30/Oct/13 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: DOCS-2157: removing copyIndeses pending SERVER-11418
Branch: master
https://github.com/mongodb/docs/commit/5023a7d8974fc5caa79f899a4db67bc135f90d13

Comment by auto [ 30/Oct/13 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: DOCS-2157: removing copyIndeses pending SERVER-11418
Branch: v2.4
https://github.com/mongodb/docs/commit/dc332d713bffc5b2f3b27cf7275c4ca93f29c326

Generated at Thu Feb 08 03:25:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.