diff options
author | Allison Easton <allison.easton@mongodb.com> | 2023-03-03 11:04:38 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-03-03 13:42:16 +0000 |
commit | 91f1168d42b88244463ec344395446d3a6e42522 (patch) | |
tree | 2e2f086336c6fd225cccf597702fab0243ea37a3 /src/mongo/db/s/collection_metadata.h | |
parent | 3baa95b8fc71d1c8b62e678463d5dbfc169e7fab (diff) | |
download | mongo-91f1168d42b88244463ec344395446d3a6e42522.tar.gz |
SERVER-70383 Rename shard version functions and parameters that are actually placement versions
Diffstat (limited to 'src/mongo/db/s/collection_metadata.h')
-rw-r--r-- | src/mongo/db/s/collection_metadata.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/mongo/db/s/collection_metadata.h b/src/mongo/db/s/collection_metadata.h index 82efe9cef9f..88b215ed900 100644 --- a/src/mongo/db/s/collection_metadata.h +++ b/src/mongo/db/s/collection_metadata.h @@ -83,30 +83,33 @@ public: void throwIfReshardingInProgress(NamespaceString const& nss) const; /** - * Returns the current shard version for the collection or UNSHARDED if it is not sharded. + * Returns the current shard's placement version for the collection or UNSHARDED if it is not + * sharded. * * Will throw ShardInvalidatedForTargeting if _thisShardId is marked as stale by * the CollectionMetadata's current chunk manager. */ - ChunkVersion getShardVersion() const { + ChunkVersion getShardPlacementVersion() const { return (isSharded() ? _cm->getVersion(_thisShardId) : ChunkVersion::UNSHARDED()); } /** - * Returns the current shard version for the collection or UNSHARDED if it is not sharded. + * Returns the current shard's placement version for the collection or UNSHARDED if it is not + * sharded. * * Will not throw an exception if _thisShardId is marked as stale by the CollectionMetadata's * current chunk manager. Only use this function when logging the returned ChunkVersion. If the - * caller must execute logic based on the returned ChunkVersion, use getShardVersion() instead. + * caller must execute logic based on the returned ChunkVersion, use getShardPlacementVersion() + * instead. */ - ChunkVersion getShardVersionForLogging() const { + ChunkVersion getShardPlacementVersionForLogging() const { return (isSharded() ? _cm->getVersionForLogging(_thisShardId) : ChunkVersion::UNSHARDED()); } /** - * Returns the current collection version or UNSHARDED if it is not sharded. + * Returns the current collection placement version or UNSHARDED if it is not sharded. */ - ChunkVersion getCollVersion() const { + ChunkVersion getCollPlacementVersion() const { return (isSharded() ? _cm->getVersion() : ChunkVersion::UNSHARDED()); } @@ -168,7 +171,7 @@ public: static BSONObj extractDocumentKey(const ShardKeyPattern* shardKeyPattern, const BSONObj& doc); /** - * String output of the collection and shard versions. + * String output of the collection and shard placement versions. */ std::string toStringBasic() const; |