summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/migration_source_manager.h
diff options
context:
space:
mode:
authorLeon Zaruvinsky <leon@mongodb.com>2016-06-22 17:34:05 -0400
committerLeon Zaruvinsky <leon@mongodb.com>2016-07-07 17:44:19 -0400
commitabaa59f3990f42aadba3b04e32dabbf3c1e47ce3 (patch)
treebf88ab49e7ec53cea70626b83e8020db75631389 /src/mongo/db/s/migration_source_manager.h
parent419a2e4eaf791a8d217050dbf0ca63149f261e0f (diff)
downloadmongo-abaa59f3990f42aadba3b04e32dabbf3c1e47ce3.tar.gz
SERVER-24415 Replace instances of shared_ptr<CollectionMetadata> with ScopedCollectionMetadata
Diffstat (limited to 'src/mongo/db/s/migration_source_manager.h')
-rw-r--r--src/mongo/db/s/migration_source_manager.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mongo/db/s/migration_source_manager.h b/src/mongo/db/s/migration_source_manager.h
index 16eddc2351b..a5f1260c098 100644
--- a/src/mongo/db/s/migration_source_manager.h
+++ b/src/mongo/db/s/migration_source_manager.h
@@ -31,6 +31,7 @@
#include <string>
#include "mongo/base/disallow_copying.h"
+#include "mongo/db/s/metadata_manager.h"
#include "mongo/s/move_chunk_request.h"
#include "mongo/s/shard_key_pattern.h"
#include "mongo/util/concurrency/notification.h"
@@ -38,7 +39,6 @@
namespace mongo {
-class CollectionMetadata;
class MigrationChunkClonerSource;
class OperationContext;
@@ -145,12 +145,10 @@ public:
void cleanupOnError(OperationContext* txn);
/**
- * Retrieves the last known committed collection metadata. What gets returned by this call may
- * change before and after the critical section has started. It should only be used for
- * diagnostics purposes and not relied on for any routing/consistency checking decisions.
+ * Returns the key pattern object for the stored committed metadata.
*/
- std::shared_ptr<CollectionMetadata> getCommittedMetadata() const {
- return _committedMetadata;
+ BSONObj getKeyPattern() const {
+ return _keyPattern;
}
/**
@@ -197,7 +195,10 @@ private:
// The cached collection metadata from just after the collection distributed lock was acquired.
// This metadata is guaranteed to not change until either failure or successful completion,
// because the distributed lock is being held. Available after stabilize stage has completed.
- std::shared_ptr<CollectionMetadata> _committedMetadata;
+ ScopedCollectionMetadata _committedMetadata;
+
+ // The key pattern of the collection whose chunks are being moved.
+ BSONObj _keyPattern;
// The chunk cloner source. Only available if there is an active migration going on. To set and
// remove it, global S lock needs to be acquired first in order to block all logOp calls and