diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-07-18 16:13:54 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-07-21 22:14:51 -0400 |
commit | ea026e685bc90c102e2305e21b8bdc096475b49b (patch) | |
tree | 9399e67cc27fd5700892ae5b28ec4aca6912440a /src/mongo/db/s/sharding_state.h | |
parent | 0c8085729e7062202bd66076e2ca7751aa338ab6 (diff) | |
download | mongo-ea026e685bc90c102e2305e21b8bdc096475b49b.tar.gz |
SERVER-24569 Maintain rangesToClean and metadataInUse on chunk migrations
This change rewrites the collection metadata refresh mechanism and puts it
entirely under the metadata manager.
Diffstat (limited to 'src/mongo/db/s/sharding_state.h')
-rw-r--r-- | src/mongo/db/s/sharding_state.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mongo/db/s/sharding_state.h b/src/mongo/db/s/sharding_state.h index 8975464136d..23e49047981 100644 --- a/src/mongo/db/s/sharding_state.h +++ b/src/mongo/db/s/sharding_state.h @@ -49,6 +49,7 @@ namespace mongo { class BSONObj; class BSONObjBuilder; struct ChunkVersion; +class CollectionMetadata; class CollectionShardingState; class ConnectionString; class OperationContext; @@ -313,14 +314,16 @@ private: void _setInitializationState_inlock(InitializationState newState); /** - * Refreshes collection metadata by asking the config server for the latest information. May or - * may not be based on a requested version. + * Refreshes collection metadata by asking the config server for the latest information and + * returns the latest version at the time the reload was done. This call does network I/O and + * should never be called with a lock. + * + * The metadataForDiff argument indicates that the specified metadata should be used as a base + * from which to only load the differences. If nullptr is passed, a full reload will be done. */ - Status _refreshMetadata(OperationContext* txn, - const std::string& ns, - const ChunkVersion& reqShardVersion, - bool useRequestedVersion, - ChunkVersion* latestShardVersion); + StatusWith<ChunkVersion> _refreshMetadata(OperationContext* txn, + const NamespaceString& nss, + const CollectionMetadata* metadataForDiff); // Initializes a TaskExecutor for cleaning up orphaned ranges void _initializeRangeDeleterTaskExecutor(); |