diff options
Diffstat (limited to 'src/mongo/db/s/migration_destination_manager.h')
-rw-r--r-- | src/mongo/db/s/migration_destination_manager.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/mongo/db/s/migration_destination_manager.h b/src/mongo/db/s/migration_destination_manager.h index b97a9b60217..78ea4741e8e 100644 --- a/src/mongo/db/s/migration_destination_manager.h +++ b/src/mongo/db/s/migration_destination_manager.h @@ -59,6 +59,13 @@ namespace repl { class OpTime; } +struct CollectionOptionsAndIndexes { + UUID uuid; + std::vector<BSONObj> indexSpecs; + BSONObj idIndexSpec; + BSONObj options; +}; + /** * Drives the receiving side of the MongoD migration process. One instance exists per shard. */ @@ -129,11 +136,19 @@ public: Status startCommit(const MigrationSessionId& sessionId); /** - * Creates the collection nss on the shard and clones the indexes and options from fromShardId. + * Gets the collection uuid, options and indexes from fromShardId. + */ + static CollectionOptionsAndIndexes getCollectionIndexesAndOptions(OperationContext* opCtx, + const NamespaceString& nss, + const ShardId& fromShardId); + + /** + * Creates the collection on the shard and clones the indexes and options. */ - static void cloneCollectionIndexesAndOptions(OperationContext* opCtx, - const NamespaceString& nss, - const ShardId& fromShardId); + static void cloneCollectionIndexesAndOptions( + OperationContext* opCtx, + const NamespaceString& nss, + const CollectionOptionsAndIndexes& collectionOptionsAndIndexes); private: /** |