summaryrefslogtreecommitdiff
path: root/src/mongo/s
diff options
context:
space:
mode:
authorBlake Oler <blake.oler@mongodb.com>2020-04-06 16:29:17 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-04-06 21:45:55 +0000
commit8ebe78a87142137172358290b9da6551db3ae322 (patch)
treecf311a3f39052520c2811eebb82c6889ef37f7be /src/mongo/s
parenta2f3c9e0c35154b676e7523cfd1e93397f6b1a27 (diff)
downloadmongo-8ebe78a87142137172358290b9da6551db3ae322.tar.gz
SERVER-47336 Reset stale shards under catalog cache mutex when returning back the same routing history
Diffstat (limited to 'src/mongo/s')
-rw-r--r--src/mongo/s/catalog_cache.cpp6
-rw-r--r--src/mongo/s/chunk_manager.cpp1
2 files changed, 6 insertions, 1 deletions
diff --git a/src/mongo/s/catalog_cache.cpp b/src/mongo/s/catalog_cache.cpp
index d80d5befe14..493b16a3690 100644
--- a/src/mongo/s/catalog_cache.cpp
+++ b/src/mongo/s/catalog_cache.cpp
@@ -786,7 +786,13 @@ void CatalogCache::_scheduleCollectionRefresh(WithLock lk,
}
itDb->second.erase(nss.ns());
return;
+ } else if (existingRoutingInfo &&
+ existingRoutingInfo->getSequenceNumber() ==
+ newRoutingInfo->getSequenceNumber()) {
+ // If the routingInfo hasn't changed, we need to manually reset stale shards.
+ newRoutingInfo->setAllShardsRefreshed();
}
+
collEntry->routingInfo = std::move(newRoutingInfo);
};
diff --git a/src/mongo/s/chunk_manager.cpp b/src/mongo/s/chunk_manager.cpp
index d256f994733..aa0eb056623 100644
--- a/src/mongo/s/chunk_manager.cpp
+++ b/src/mongo/s/chunk_manager.cpp
@@ -636,7 +636,6 @@ std::shared_ptr<RoutingTableHistory> RoutingTableHistory::makeUpdated(
// sequence number to detect batch writes not making progress because of chunks moving across
// shards too frequently.
if (collectionVersion == startingCollectionVersion) {
- setAllShardsRefreshed();
return shared_from_this();
}