summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorEsha Maharishi <esha.maharishi@mongodb.com>2018-04-13 17:40:04 -0400
committerEsha Maharishi <esha.maharishi@mongodb.com>2018-04-16 13:59:13 -0400
commitc02574298a711b6de8a3d89cedcfe98040a6f55b (patch)
tree678c5a9035c1511f0333e5d01f6047592478c2ea /src/mongo/db
parent721b194f8c194db500a687e62526c8e1f8a65a10 (diff)
downloadmongo-c02574298a711b6de8a3d89cedcfe98040a6f55b.tar.gz
SERVER-33356 Ensure shards' persisted collection cache picks up collection UUIDs after setFCV=4.0
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/commands/set_feature_compatibility_version_command.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp
index 2d62ac9f343..c377eb1ef53 100644
--- a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp
+++ b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp
@@ -173,10 +173,15 @@ public:
// Upgrade shards before config finishes its upgrade.
if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer) {
auto allDbs = uassertStatusOK(Grid::get(opCtx)->catalogClient()->getAllDBs(
- opCtx, repl::ReadConcernLevel::kLocalReadConcern));
+ opCtx, repl::ReadConcernLevel::kLocalReadConcern))
+ .value;
+
+ // The 'config' dataabase contains the sharded 'config.system.sessions' collection,
+ // but does not have an entry in config.databases.
+ allDbs.emplace_back("config", ShardId("config"), true);
auto clusterTime = LogicalClock::get(opCtx)->getClusterTime().asTimestamp();
- for (const auto& db : allDbs.value) {
+ for (const auto& db : allDbs) {
const auto dbVersion = databaseVersion::makeNew();
uassertStatusOK(Grid::get(opCtx)->catalogClient()->updateConfigDocument(
@@ -258,10 +263,15 @@ public:
BSON(FeatureCompatibilityVersionCommandParser::kCommandName
<< requestedVersion)))));
- const auto allDbs = uassertStatusOK(Grid::get(opCtx)->catalogClient()->getAllDBs(
- opCtx, repl::ReadConcernLevel::kLocalReadConcern));
+ auto allDbs = uassertStatusOK(Grid::get(opCtx)->catalogClient()->getAllDBs(
+ opCtx, repl::ReadConcernLevel::kLocalReadConcern))
+ .value;
+
+ // The 'config' dataabase contains the sharded 'config.system.sessions' collection,
+ // but does not have an entry in config.databases.
+ allDbs.emplace_back("config", ShardId("config"), true);
- for (const auto& db : allDbs.value) {
+ for (const auto& db : allDbs) {
uassertStatusOK(Grid::get(opCtx)->catalogClient()->updateConfigDocument(
opCtx,
DatabaseType::ConfigNS,