diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2020-11-03 14:08:19 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-11-11 14:52:36 +0000 |
commit | 7950f071b21957be1ab8e5ac2db8b650695a2bd0 (patch) | |
tree | c18442fd863b1d955d8194a2ddf6759201182e08 /src/mongo/s/chunk_manager.h | |
parent | b43f6fefe1ac3e941fd55d5452a1ee21e7ff0ae6 (diff) | |
download | mongo-7950f071b21957be1ab8e5ac2db8b650695a2bd0.tar.gz |
SERVER-50027 Implement an 'allowMigrations' collection property
Diffstat (limited to 'src/mongo/s/chunk_manager.h')
-rw-r--r-- | src/mongo/s/chunk_manager.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mongo/s/chunk_manager.h b/src/mongo/s/chunk_manager.h index 68a439e0064..235c18e9121 100644 --- a/src/mongo/s/chunk_manager.h +++ b/src/mongo/s/chunk_manager.h @@ -166,6 +166,7 @@ public: bool unique, OID epoch, boost::optional<TypeCollectionReshardingFields> reshardingFields, + bool allowMigrations, const std::vector<ChunkType>& chunks); /** @@ -182,6 +183,7 @@ public: */ RoutingTableHistory makeUpdated( boost::optional<TypeCollectionReshardingFields> reshardingFields, + bool allowMigrations, const std::vector<ChunkType>& changedChunks) const; const NamespaceString& nss() const { @@ -280,6 +282,10 @@ public: return _reshardingFields; } + bool allowMigrations() const { + return _allowMigrations; + } + private: friend class ChunkManager; @@ -289,6 +295,7 @@ private: std::unique_ptr<CollatorInterface> defaultCollator, bool unique, boost::optional<TypeCollectionReshardingFields> reshardingFields, + bool allowMigrations, ChunkMap chunkMap); ChunkVersion _getVersion(const ShardId& shardName, bool throwOnStaleShard) const; @@ -314,6 +321,8 @@ private: // for this collection. boost::optional<TypeCollectionReshardingFields> _reshardingFields; + bool _allowMigrations; + // Map from the max for each chunk to an entry describing the chunk. The union of all chunks' // ranges must cover the complete space from [MinKey, MaxKey). ChunkMap _chunkMap; @@ -460,6 +469,12 @@ public: return bool(_rt->optRt); } + /** + * Indicates that this collection must not honour any moveChunk requests, because it is required + * to provide a stable view of its constituent shards. + */ + bool allowMigrations() const; + const ShardId& dbPrimary() const { return _dbPrimary; } |