summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/shard_metadata_util.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2022-05-17 07:35:26 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-05-17 08:23:36 +0000
commit03d8a49fd41dccdce2f2ec5bdaeb30162bee69e8 (patch)
treec6a36567cd1a695f946d9f363ff10ac64b409606 /src/mongo/db/s/shard_metadata_util.cpp
parentad2271e4c9dfeffd8a11b04a23da361483d695fb (diff)
downloadmongo-03d8a49fd41dccdce2f2ec5bdaeb30162bee69e8.tar.gz
SERVER-66472 Pull the collection generation out of ChunkVersion
Diffstat (limited to 'src/mongo/db/s/shard_metadata_util.cpp')
-rw-r--r--src/mongo/db/s/shard_metadata_util.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/db/s/shard_metadata_util.cpp b/src/mongo/db/s/shard_metadata_util.cpp
index 515fca1e04f..1651cfc167e 100644
--- a/src/mongo/db/s/shard_metadata_util.cpp
+++ b/src/mongo/db/s/shard_metadata_util.cpp
@@ -88,12 +88,12 @@ QueryAndSort createShardChunkDiffQuery(const ChunkVersion& collectionVersion) {
}
bool RefreshState::operator==(const RefreshState& other) const {
- return (other.epoch == epoch) && (other.refreshing == refreshing) &&
- (other.lastRefreshedCollectionVersion == lastRefreshedCollectionVersion);
+ return generation.isSameCollection(other.generation) && (refreshing == other.refreshing) &&
+ (lastRefreshedCollectionVersion == other.lastRefreshedCollectionVersion);
}
std::string RefreshState::toString() const {
- return str::stream() << "epoch: " << epoch
+ return str::stream() << "generation: " << generation.toString()
<< ", refreshing: " << (refreshing ? "true" : "false")
<< ", lastRefreshedCollectionVersion: "
<< lastRefreshedCollectionVersion.toString();
@@ -133,7 +133,7 @@ StatusWith<RefreshState> getPersistedRefreshFlags(OperationContext* opCtx,
invariant(!entry.getLastRefreshedCollectionVersion());
}
- return RefreshState{entry.getEpoch(),
+ return RefreshState{CollectionGeneration(entry.getEpoch(), entry.getTimestamp()),
// If the refreshing field has not yet been added, this means that the first
// refresh has started, but no chunks have ever yet been applied, around
// which these flags are set. So default to refreshing true because the