[SERVER-32643] ensure 'clone' command can be used to copy catalog info (indexes, options, and views) for *all* collections in the db Created: 10/Jan/18  Updated: 30/Oct/23  Resolved: 24/Jan/18

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.6.2
Fix Version/s: 3.7.2

Type: Task Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Kaitlin Mahar
Resolution: Fixed Votes: 0
Labels: read-only-views
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-8059 After movePrimary, db.getCollectionNa... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2018-01-15, Sharding 2018-01-29
Participants:

 Description   

This is the 'clone' command (https://github.com/mongodb/mongo/blob/r3.6.1/src/mongo/db/commands/clone.cpp) and how it's currently used by movePrimary (https://github.com/mongodb/mongo/blob/r3.6.1/src/mongo/db/s/config/configsvr_move_primary_command.cpp#L209-L240)

Today, movePrimary uses the 'clone' command to copy
1) the data for all unsharded collections in the db
2) the catalog info (indexes, options, and views) for those unsharded collections

We want to change the second so that the catalog info for all collections (sharded and unsharded) is copied.

This ticket should add a jstest that creates two collections with non-default options (through createCollection), and on each

It should then shard one of the collections, call movePrimary, and demonstrate (by calling listCollections and listIndexes directly on the new primary shard) that the new primary shard copied the indexes, options, and views for both the unsharded and sharded collections.



 Comments   
Comment by Githook User [ 23/Jan/18 ]

Author:

{'name': 'Kaitlin Mahar', 'email': 'kaitlin.mahar@mongodb.com', 'username': 'kmahar'}

Message: SERVER-32643 Add a metadataOnly flag to the clone command
Branch: master
https://github.com/mongodb/mongo/commit/251ac77d37f7711e30130f64cbf3f4343a174990

Comment by Esha Maharishi (Inactive) [ 10/Jan/18 ]

It might be helpful to write the jstest first, and see what catalog info is currently copied over for the unsharded and sharded collections.

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