diff options
author | Blake Oler <blake.oler@mongodb.com> | 2018-06-20 12:33:57 -0400 |
---|---|---|
committer | Blake Oler <blake.oler@mongodb.com> | 2018-06-20 13:49:55 -0400 |
commit | f4179263a47cf5313067a4ee96bc9d3f972aa6ee (patch) | |
tree | 65276532182bb0ffc65ada4e4581def6e7589416 /src/mongo/db/s/config/sharding_catalog_manager_database_operations.cpp | |
parent | c6b10c46cce635574297577f75f57b792b508893 (diff) | |
download | mongo-f4179263a47cf5313067a4ee96bc9d3f972aa6ee.tar.gz |
SERVER-34470 Make DatabaseVersion non-optional on the config server's DatabaseType
Diffstat (limited to 'src/mongo/db/s/config/sharding_catalog_manager_database_operations.cpp')
-rw-r--r-- | src/mongo/db/s/config/sharding_catalog_manager_database_operations.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/mongo/db/s/config/sharding_catalog_manager_database_operations.cpp b/src/mongo/db/s/config/sharding_catalog_manager_database_operations.cpp index 8feb307bedc..fe87d6f7c1a 100644 --- a/src/mongo/db/s/config/sharding_catalog_manager_database_operations.cpp +++ b/src/mongo/db/s/config/sharding_catalog_manager_database_operations.cpp @@ -226,16 +226,10 @@ Status ShardingCatalogManager::commitMovePrimary(OperationContext* opCtx, auto const currentDatabaseVersion = dbType.getVersion(); - uassert(ErrorCodes::InternalError, - str::stream() << "DatabaseVersion doesn't exist in database entry despite the config " - << "server being in FCV 4.0" - << dbType.toBSON(), - currentDatabaseVersion != boost::none); - - newDbType.setVersion(databaseVersion::makeIncremented(*currentDatabaseVersion)); + newDbType.setVersion(databaseVersion::makeIncremented(currentDatabaseVersion)); auto updateQueryBuilder = BSONObjBuilder(BSON(DatabaseType::name << dbname)); - updateQueryBuilder.append(DatabaseType::version.name(), currentDatabaseVersion->toBSON()); + updateQueryBuilder.append(DatabaseType::version.name(), currentDatabaseVersion.toBSON()); auto updateStatus = Grid::get(opCtx)->catalogClient()->updateConfigDocument( opCtx, @@ -258,7 +252,7 @@ Status ShardingCatalogManager::commitMovePrimary(OperationContext* opCtx, uassert(ErrorCodes::IncompatibleShardingMetadata, str::stream() << "Tried to update primary shard for database '" << dbname << " with version " - << currentDatabaseVersion->getLastMod(), + << currentDatabaseVersion.getLastMod(), updateStatus.getValue()); // Ensure the next attempt to retrieve the database or any of its collections will do a full |