summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/flush_database_cache_updates_command.cpp
diff options
context:
space:
mode:
authorjannaerin <golden.janna@gmail.com>2018-04-03 13:30:30 -0400
committerjannaerin <golden.janna@gmail.com>2018-04-05 20:29:05 -0400
commit7a48a263485a585dac1e1289c830eafd35a3d54b (patch)
tree38544c586218bfa72bf7fd842c3ed6019e788ae3 /src/mongo/db/s/flush_database_cache_updates_command.cpp
parent265a38952f11a5d9a6144a22f10dc59b138e0b69 (diff)
downloadmongo-7a48a263485a585dac1e1289c830eafd35a3d54b.tar.gz
SERVER-34145 Persist database version on shard
Diffstat (limited to 'src/mongo/db/s/flush_database_cache_updates_command.cpp')
-rw-r--r--src/mongo/db/s/flush_database_cache_updates_command.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/s/flush_database_cache_updates_command.cpp b/src/mongo/db/s/flush_database_cache_updates_command.cpp
index deae485cca9..362c45dc8e8 100644
--- a/src/mongo/db/s/flush_database_cache_updates_command.cpp
+++ b/src/mongo/db/s/flush_database_cache_updates_command.cpp
@@ -121,6 +121,12 @@ public:
{
AutoGetDb autoDb(opCtx, name, MODE_IS);
+ if (!autoDb.getDb()) {
+ uasserted(ErrorCodes::NamespaceNotFound,
+ str::stream() << "Can't issue _flushDatabaseCacheUpdates on the database "
+ << name
+ << " because it does not exist on this shard.");
+ }
// If the primary is in the critical section, secondaries must wait for the commit to
// finish on the primary in case a secondary's caller has an afterClusterTime inclusive