diff options
Diffstat (limited to 'jstests')
6 files changed, 19 insertions, 16 deletions
diff --git a/jstests/core/views/views_all_commands.js b/jstests/core/views/views_all_commands.js index 92ee56b1585..c4775c0a7b3 100644 --- a/jstests/core/views/views_all_commands.js +++ b/jstests/core/views/views_all_commands.js @@ -75,6 +75,7 @@ _configsvrShardCollection: {skip: isAnInternalCommand}, _configsvrSetFeatureCompatibilityVersion: {skip: isAnInternalCommand}, _configsvrUpdateZoneKeyRange: {skip: isAnInternalCommand}, + _flushRoutingTableCacheUpdates: {skip: isUnrelated}, _getNextSessionMods: {skip: isAnInternalCommand}, _getUserCacheGeneration: {skip: isAnInternalCommand}, _hashBSONElement: {skip: isAnInternalCommand}, @@ -215,7 +216,6 @@ }, flushRouterConfig: {skip: isUnrelated}, forceerror: {skip: isUnrelated}, - forceRoutingTableRefresh: {skip: isUnrelated}, fsync: {skip: isUnrelated}, fsyncUnlock: {skip: isUnrelated}, geoNear: { diff --git a/jstests/libs/override_methods/check_uuids_consistent_across_cluster.js b/jstests/libs/override_methods/check_uuids_consistent_across_cluster.js index ff07c32796a..3b6636df7ac 100644 --- a/jstests/libs/override_methods/check_uuids_consistent_across_cluster.js +++ b/jstests/libs/override_methods/check_uuids_consistent_across_cluster.js @@ -76,7 +76,8 @@ ShardingTest.prototype.checkUUIDsConsistentAcrossCluster = function() { }); for (let authoritativeCollMetadata of authoritativeCollMetadataArr) { - const[dbName, collName] = parseNs(authoritativeCollMetadata._id); + const ns = authoritativeCollMetadata._id; + const[dbName, collName] = parseNs(ns); for (let shardConnString of authoritativeCollMetadata.shardConnStrings) { // A connection the shard may not be cached in ShardingTest if the shard was added @@ -87,8 +88,8 @@ ShardingTest.prototype.checkUUIDsConsistentAcrossCluster = function() { } let shardConn = shardConnStringToConn[shardConnString]; - print("running listCollections against " + shardConn + - " to check UUID consistency for " + authoritativeCollMetadata._id); + print("checking that the UUID in the storage catalog for " + ns + " on " + + shardConn + " is consistent with the config server"); const actualCollMetadata = shardConn.getDB(dbName).getCollectionInfos({name: collName})[0]; assert.eq(authoritativeCollMetadata.collInfo.uuid, @@ -98,11 +99,13 @@ ShardingTest.prototype.checkUUIDsConsistentAcrossCluster = function() { ", actual collection info on shard " + shardConnString + ": " + tojson(actualCollMetadata)); - print("checking " + shardConn + " config.collections" + - " for UUID consistency with " + authoritativeCollMetadata._id); - const configDB = shardConn.getDB('config'); + print("checking that the UUID in config.cache.collections for " + ns + " on " + + shardConn + " is consistent with the config server"); + assert.commandWorked(shardConn.adminCommand( + {_flushRoutingTableCacheUpdates: ns, syncFromConfig: false})); const actualConfigMetadata = - configDB.cache.collections.find({"_id": dbName + "." + collName})[0]; + shardConn.getDB("config").getCollection("cache.collections").find({"_id": + ns})[0]; assert.eq(authoritativeCollMetadata.collInfo.uuid, actualConfigMetadata.uuid, "authoritative collection info on config server: " + diff --git a/jstests/sharding/dump_coll_metadata.js b/jstests/sharding/dump_coll_metadata.js index 9b38a3c416c..30726f4746d 100644 --- a/jstests/sharding/dump_coll_metadata.js +++ b/jstests/sharding/dump_coll_metadata.js @@ -37,7 +37,7 @@ // cause the shard to refresh. assert.commandWorked(admin.runCommand({split: coll + "", middle: {_id: 0}})); assert.commandWorked( - st.shard0.getDB('admin').runCommand({forceRoutingTableRefresh: coll + ""})); + st.shard0.getDB('admin').runCommand({_flushRoutingTableCacheUpdates: coll + ""})); assert.commandWorked(shardAdmin.runCommand({getShardVersion: coll + ""})); printjson(shardAdmin.runCommand({getShardVersion: coll + "", fullMetadata: true})); diff --git a/jstests/sharding/safe_secondary_reads_drop_recreate.js b/jstests/sharding/safe_secondary_reads_drop_recreate.js index 245a2bf5a30..a289eb6e363 100644 --- a/jstests/sharding/safe_secondary_reads_drop_recreate.js +++ b/jstests/sharding/safe_secondary_reads_drop_recreate.js @@ -61,6 +61,7 @@ _configsvrShardCollection: {skip: "primary only"}, _configsvrSetFeatureCompatibilityVersion: {skip: "primary only"}, _configsvrUpdateZoneKeyRange: {skip: "primary only"}, + _flushRoutingTableCacheUpdates: {skip: "does not return user data"}, _getUserCacheGeneration: {skip: "does not return user data"}, _hashBSONElement: {skip: "does not return user data"}, _isSelf: {skip: "does not return user data"}, @@ -173,7 +174,6 @@ findAndModify: {skip: "primary only"}, flushRouterConfig: {skip: "does not return user data"}, forceerror: {skip: "does not return user data"}, - forceRoutingTableRefresh: {skip: "does not return user data"}, fsync: {skip: "does not return user data"}, fsyncUnlock: {skip: "does not return user data"}, geoNear: { @@ -329,8 +329,8 @@ // Ensure the latest version changes have been persisted and propagate to the secondary // before we target it with versioned commands. - assert.commandWorked( - st.rs0.getPrimary().getDB('admin').runCommand({forceRoutingTableRefresh: nss})); + assert.commandWorked(st.rs0.getPrimary().getDB('admin').runCommand( + {_flushRoutingTableCacheUpdates: nss})); st.rs0.awaitReplication(); let res = staleMongos.getDB(db).runCommand(Object.assign( @@ -393,8 +393,8 @@ // Ensure the latest version changes have been persisted and propagate to the secondary // before we target it with versioned commands. - assert.commandWorked( - st.rs0.getPrimary().getDB('admin').runCommand({forceRoutingTableRefresh: nss})); + assert.commandWorked(st.rs0.getPrimary().getDB('admin').runCommand( + {_flushRoutingTableCacheUpdates: nss})); st.rs0.awaitReplication(); let res = staleMongos.getDB(db).runCommand(Object.assign( diff --git a/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js b/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js index 41cd6593530..377abed53e0 100644 --- a/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js +++ b/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js @@ -68,6 +68,7 @@ _configsvrShardCollection: {skip: "primary only"}, _configsvrSetFeatureCompatibilityVersion: {skip: "primary only"}, _configsvrUpdateZoneKeyRange: {skip: "primary only"}, + _flushRoutingTableCacheUpdates: {skip: "does not return user data"}, _getUserCacheGeneration: {skip: "does not return user data"}, _hashBSONElement: {skip: "does not return user data"}, _isSelf: {skip: "does not return user data"}, @@ -203,7 +204,6 @@ findAndModify: {skip: "primary only"}, flushRouterConfig: {skip: "does not return user data"}, forceerror: {skip: "does not return user data"}, - forceRoutingTableRefresh: {skip: "does not return user data"}, fsync: {skip: "does not return user data"}, fsyncUnlock: {skip: "does not return user data"}, geoNear: { diff --git a/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js b/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js index 28640f5efaf..8d093ce7c51 100644 --- a/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js +++ b/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js @@ -61,6 +61,7 @@ _configsvrShardCollection: {skip: "primary only"}, _configsvrSetFeatureCompatibilityVersion: {skip: "primary only"}, _configsvrUpdateZoneKeyRange: {skip: "primary only"}, + _flushRoutingTableCacheUpdates: {skip: "does not return user data"}, _getUserCacheGeneration: {skip: "does not return user data"}, _hashBSONElement: {skip: "does not return user data"}, _isSelf: {skip: "does not return user data"}, @@ -176,7 +177,6 @@ findAndModify: {skip: "primary only"}, flushRouterConfig: {skip: "does not return user data"}, forceerror: {skip: "does not return user data"}, - forceRoutingTableRefresh: {skip: "does not return user data"}, fsync: {skip: "does not return user data"}, fsyncUnlock: {skip: "does not return user data"}, geoNear: { |