summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/flush_database_cache_updates_command.cpp
diff options
context:
space:
mode:
authorjannaerin <golden.janna@gmail.com>2019-07-03 13:24:58 -0400
committerjannaerin <golden.janna@gmail.com>2019-07-08 17:09:04 -0400
commitc6468f7d3ac783b4bcdeb6744fc976c8ecee2969 (patch)
tree1f425d3bc85d26cd24ff1fdf0d8c9ad81aca8d66 /src/mongo/db/s/flush_database_cache_updates_command.cpp
parent13434801be12a72d370147aed4c2ac194e658062 (diff)
downloadmongo-c6468f7d3ac783b4bcdeb6744fc976c8ecee2969.tar.gz
SERVER-34431 MoveDatabaseShardingState into its own map
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.cpp13
1 files changed, 3 insertions, 10 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 f1c6009329d..5e4fadfaae0 100644
--- a/src/mongo/db/s/flush_database_cache_updates_command.cpp
+++ b/src/mongo/db/s/flush_database_cache_updates_command.cpp
@@ -115,23 +115,16 @@ public:
{
AutoGetDb autoDb(opCtx, _dbName(), MODE_IS);
- if (!autoDb.getDb()) {
- uasserted(ErrorCodes::NamespaceNotFound,
- str::stream()
- << "Can't issue _flushDatabaseCacheUpdates on the database "
- << _dbName()
- << " 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 of the commit (and new writes to the committed chunk) that hasn't yet
// propagated back to this shard. This ensures the read your own writes causal
// consistency guarantee.
- auto& dss = DatabaseShardingState::get(autoDb.getDb());
- auto dssLock = DatabaseShardingState::DSSLock::lockShared(opCtx, &dss);
+ const auto dss = DatabaseShardingState::get(opCtx, _dbName());
+ auto dssLock = DatabaseShardingState::DSSLock::lockShared(opCtx, dss);
- if (auto criticalSectionSignal = dss.getCriticalSectionSignal(
+ if (auto criticalSectionSignal = dss->getCriticalSectionSignal(
ShardingMigrationCriticalSection::kRead, dssLock)) {
oss.setMigrationCriticalSectionSignal(criticalSectionSignal);
}