diff options
author | Esha Maharishi <esha.maharishi@mongodb.com> | 2017-08-22 18:06:47 -0400 |
---|---|---|
committer | Esha Maharishi <esha.maharishi@mongodb.com> | 2017-09-25 11:27:23 -0400 |
commit | 62fe0f89e9fa15c69f912d31b822b3631f691fe7 (patch) | |
tree | f1f1644eee12ca54fd1a02d111d3155ea6707c21 /jstests/sharding | |
parent | f9a41c8419554d727381c0b5766193f48c0ddc98 (diff) | |
download | mongo-62fe0f89e9fa15c69f912d31b822b3631f691fe7.tar.gz |
SERVER-30511 call checkUUIDsConsistentAcrossCluster() before shutting down a ShardingTest
Diffstat (limited to 'jstests/sharding')
22 files changed, 105 insertions, 2 deletions
diff --git a/jstests/sharding/all_config_hosts_down.js b/jstests/sharding/all_config_hosts_down.js index 2376ca063b8..712b9b2dc19 100644 --- a/jstests/sharding/all_config_hosts_down.js +++ b/jstests/sharding/all_config_hosts_down.js @@ -2,6 +2,11 @@ // Test for what happens when config servers are down and the database config is loaded // Should fail sanely // + +// Checking UUID consistency involves talking to the config servers, which are shut down in this +// test. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + (function() { "use strict"; diff --git a/jstests/sharding/all_config_servers_blackholed_from_mongos.js b/jstests/sharding/all_config_servers_blackholed_from_mongos.js index f575ba26276..f10d1c71fa2 100644 --- a/jstests/sharding/all_config_servers_blackholed_from_mongos.js +++ b/jstests/sharding/all_config_servers_blackholed_from_mongos.js @@ -1,5 +1,10 @@ // Ensures that if the config servers are blackholed from the point of view of MongoS, metadata // operations do not get stuck forever. + +// Checking UUID consistency involves talking to config servers through mongos, but mongos is +// blackholed from the config servers in this test. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + (function() { 'use strict'; diff --git a/jstests/sharding/authConnectionHook.js b/jstests/sharding/authConnectionHook.js index c06383804c2..24b512b6f18 100644 --- a/jstests/sharding/authConnectionHook.js +++ b/jstests/sharding/authConnectionHook.js @@ -8,6 +8,11 @@ * * @tags: [requires_persistence] */ + +// The UUID consistency check uses connections to shards cached on the ShardingTest object, but this +// test restarts a shard, so the cached connection is not usable. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + (function() { 'use strict'; diff --git a/jstests/sharding/auth_no_config_primary.js b/jstests/sharding/auth_no_config_primary.js index a767ce4eee7..8620c317272 100644 --- a/jstests/sharding/auth_no_config_primary.js +++ b/jstests/sharding/auth_no_config_primary.js @@ -5,6 +5,11 @@ * across a restart. * @tags: [requires_persistence] */ + +// Checking UUID consistency involves talking to the config server primary, but there is no config +// server primary by the end of this test. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + (function() { 'use strict'; diff --git a/jstests/sharding/batch_write_command_sharded.js b/jstests/sharding/batch_write_command_sharded.js index 7ede1900455..a0d4b6356f1 100644 --- a/jstests/sharding/batch_write_command_sharded.js +++ b/jstests/sharding/batch_write_command_sharded.js @@ -3,6 +3,11 @@ // NOTE: Basic write functionality is tested via the passthrough tests, this file should contain // *only* mongos-specific tests. // + +// Checking UUID consistency involves talking to the config server primary, but there is no config +// server primary by the end of this test. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + (function() { "use strict"; @@ -233,4 +238,4 @@ MongoRunner.stopMongos(staleMongos); st.stop(); -}());
\ No newline at end of file +}()); diff --git a/jstests/sharding/config_rs_no_primary.js b/jstests/sharding/config_rs_no_primary.js index 11d9a8e41aa..fee859a994e 100644 --- a/jstests/sharding/config_rs_no_primary.js +++ b/jstests/sharding/config_rs_no_primary.js @@ -1,5 +1,10 @@ // Tests operation of the cluster when the config servers have no primary and thus the cluster // metadata is in read-only mode. + +// Checking UUID consistency involves talking to the config server primary, but there is no config +// server primary by the end of this test. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + (function() { "use strict"; @@ -51,4 +56,4 @@ testOps(st.s); st.stop(); -}());
\ No newline at end of file +}()); diff --git a/jstests/sharding/cursor_valid_after_shard_stepdown.js b/jstests/sharding/cursor_valid_after_shard_stepdown.js index c51e7191e3f..ea0dd72338f 100644 --- a/jstests/sharding/cursor_valid_after_shard_stepdown.js +++ b/jstests/sharding/cursor_valid_after_shard_stepdown.js @@ -1,3 +1,8 @@ + +// Checking UUID consistency involves talking to the shard primary, but by the end of this test, the +// shard does not have a primary. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + (function() { 'use strict'; diff --git a/jstests/sharding/features1.js b/jstests/sharding/features1.js index 254e919f237..d7f0fa13239 100644 --- a/jstests/sharding/features1.js +++ b/jstests/sharding/features1.js @@ -1,3 +1,7 @@ +// TODO (SERVER-30344): enable UUID consistency check once createIndexes does not cause shards to +// have inconsistent UUIDs. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + (function() { var s = new ShardingTest({name: "features1", shards: 2, mongos: 1}); diff --git a/jstests/sharding/geo_near_random1.js b/jstests/sharding/geo_near_random1.js index 707d3c550a0..23c98df2fd1 100644 --- a/jstests/sharding/geo_near_random1.js +++ b/jstests/sharding/geo_near_random1.js @@ -1,4 +1,9 @@ // This tests all points using $near + +// TODO (SERVER-30344): enable UUID consistency check once createIndexes does not cause shards to +// have inconsistent UUIDs. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + (function() { load("jstests/libs/geo_near_random.js"); diff --git a/jstests/sharding/geo_near_random2.js b/jstests/sharding/geo_near_random2.js index 4833f5bc0d0..aac8aa55209 100644 --- a/jstests/sharding/geo_near_random2.js +++ b/jstests/sharding/geo_near_random2.js @@ -1,4 +1,9 @@ // This tests 1% of all points using $near and $nearSphere + +// TODO (SERVER-30344): enable UUID consistency check once createIndexes does not cause shards to +// have inconsistent UUIDs. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + (function() { load("jstests/libs/geo_near_random.js"); diff --git a/jstests/sharding/lagged_config_secondary.js b/jstests/sharding/lagged_config_secondary.js index 3d109dd9056..95e68a7a7c0 100644 --- a/jstests/sharding/lagged_config_secondary.js +++ b/jstests/sharding/lagged_config_secondary.js @@ -2,6 +2,11 @@ * Test that mongos times out when the config server replica set only contains nodes that * are behind the majority opTime. */ + +// Checking UUID consistency involves mongos being able to do a read from the config server, but +// this test is designed to make mongos time out when reading from the config server. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + (function() { var st = new ShardingTest( {shards: 1, configReplSetTestOptions: {settings: {chainingAllowed: false}}}); diff --git a/jstests/sharding/localhostAuthBypass.js b/jstests/sharding/localhostAuthBypass.js index 319c0eb2b79..61bbabd762a 100644 --- a/jstests/sharding/localhostAuthBypass.js +++ b/jstests/sharding/localhostAuthBypass.js @@ -2,6 +2,12 @@ // // This test is to ensure that localhost authentication works correctly against a sharded // cluster whether they are hosted with "localhost" or a hostname. + +// Checking UUID consistency, which occurs on ShardingTest.stop, involves using a mongos to read +// data on the config server, but this test uses a special shutdown function which stops the +// mongoses before calling ShardingTest.stop. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + (function() { 'use strict'; diff --git a/jstests/sharding/migration_sets_fromMigrate_flag.js b/jstests/sharding/migration_sets_fromMigrate_flag.js index a61e2efd7e6..5ec4121ea77 100644 --- a/jstests/sharding/migration_sets_fromMigrate_flag.js +++ b/jstests/sharding/migration_sets_fromMigrate_flag.js @@ -14,6 +14,11 @@ // delete op is done during chunk migration within the chunk range. // +// This test inserts documents into a sharded collection by directly writing to the shards, so the +// collection is created on the non-primary shard with a shard-generated UUID rather than with a +// UUID propagated from the primary shard. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + load('./jstests/libs/chunk_manipulation_util.js'); (function() { diff --git a/jstests/sharding/mongos_rs_auth_shard_failure_tolerance.js b/jstests/sharding/mongos_rs_auth_shard_failure_tolerance.js index a23d93829db..a5ae6c62aa6 100644 --- a/jstests/sharding/mongos_rs_auth_shard_failure_tolerance.js +++ b/jstests/sharding/mongos_rs_auth_shard_failure_tolerance.js @@ -11,6 +11,10 @@ // (connection connected after shard change). // +// Checking UUID consistency involves talking to shard primaries, but by the end of this test, one +// shard does not have a primary. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + var options = {rs: true, rsOptions: {nodes: 2}, keyFile: "jstests/libs/key1"}; var st = new ShardingTest({shards: 3, mongos: 1, other: options}); diff --git a/jstests/sharding/mongos_rs_shard_failure_tolerance.js b/jstests/sharding/mongos_rs_shard_failure_tolerance.js index 7ec30374c22..ac117877cb5 100644 --- a/jstests/sharding/mongos_rs_shard_failure_tolerance.js +++ b/jstests/sharding/mongos_rs_shard_failure_tolerance.js @@ -10,6 +10,11 @@ // sequence), idle (connection is connected but not used before a shard change), and new // (connection connected after shard change). // + +// Checking UUID consistency involves talking to shard primaries, but by the end of this test, one +// shard does not have a primary. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + (function() { 'use strict'; diff --git a/jstests/sharding/mongos_shard_failure_tolerance.js b/jstests/sharding/mongos_shard_failure_tolerance.js index aa4351e6303..0c189fd1a55 100644 --- a/jstests/sharding/mongos_shard_failure_tolerance.js +++ b/jstests/sharding/mongos_shard_failure_tolerance.js @@ -10,6 +10,9 @@ // sequence), idle (connection is connected but not used before a shard change), and new // (connection connected after shard change). // +// Checking UUID consistency involves talking to shards, but this test shuts down shards. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + (function() { 'use strict'; diff --git a/jstests/sharding/move_chunk_missing_idx.js b/jstests/sharding/move_chunk_missing_idx.js index 8125e8e6600..40ff85f9df0 100644 --- a/jstests/sharding/move_chunk_missing_idx.js +++ b/jstests/sharding/move_chunk_missing_idx.js @@ -3,6 +3,10 @@ * have the index and is not empty. */ +// TODO (SERVER-30344): enable UUID consistency check once createIndexes does not cause shards to +// have inconsistent UUIDs. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + var st = new ShardingTest({shards: 2}); var testDB = st.s.getDB('test'); diff --git a/jstests/sharding/read_pref_cmd.js b/jstests/sharding/read_pref_cmd.js index 62ac98b80bc..10b8a883507 100644 --- a/jstests/sharding/read_pref_cmd.js +++ b/jstests/sharding/read_pref_cmd.js @@ -2,6 +2,10 @@ load("jstests/replsets/rslib.js"); var NODE_COUNT = 2; +// Checking UUID consistency involves reading from the config server through mongos, but this test +// sets an invalid readPreference on the connection to the mongos. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + /** * Prepare to call testReadPreference() or assertFailure(). */ diff --git a/jstests/sharding/remove2.js b/jstests/sharding/remove2.js index 1fed38f6dae..da609e50577 100644 --- a/jstests/sharding/remove2.js +++ b/jstests/sharding/remove2.js @@ -2,6 +2,10 @@ load("jstests/replsets/rslib.js"); +// The UUID consistency check uses connections to shards cached on the ShardingTest object, but this +// test restarts a shard, so the cached connection is not usable. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + (function() { 'use strict'; diff --git a/jstests/sharding/return_partial_shards_down.js b/jstests/sharding/return_partial_shards_down.js index 6d1c215127f..c3e0f3f2e27 100644 --- a/jstests/sharding/return_partial_shards_down.js +++ b/jstests/sharding/return_partial_shards_down.js @@ -2,6 +2,9 @@ // Tests that zero results are correctly returned with returnPartial and shards down // +// Checking UUID consistency involves talking to shards, but this test shuts down shards. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + var st = new ShardingTest({shards: 3, mongos: 1, other: {mongosOptions: {verbose: 2}}}); // Stop balancer, we're doing our own manual chunk distribution diff --git a/jstests/sharding/sharding_multiple_ns_rs.js b/jstests/sharding/sharding_multiple_ns_rs.js index 183d6c24878..d59eac888cb 100644 --- a/jstests/sharding/sharding_multiple_ns_rs.js +++ b/jstests/sharding/sharding_multiple_ns_rs.js @@ -1,3 +1,9 @@ +// When checking UUID consistency, the shell attempts to run a command on the node it believes is +// primary in each shard. However, this test shuts down the primary of the shard. Since whether or +// not the shell detects the new primary before issuing the command is nondeterministic, skip the +// consistency check for this test. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + (function() { load("jstests/replsets/rslib.js"); diff --git a/jstests/sharding/startup_with_all_configs_down.js b/jstests/sharding/startup_with_all_configs_down.js index e97442b6dd8..bd791b71b2f 100644 --- a/jstests/sharding/startup_with_all_configs_down.js +++ b/jstests/sharding/startup_with_all_configs_down.js @@ -5,6 +5,11 @@ // This test involves restarting a standalone shard, so cannot be run on ephemeral storage engines. // A restarted standalone will lose all data when using an ephemeral storage engine. // @tags: [requires_persistence] + +// The UUID consistency check uses connections to shards cached on the ShardingTest object, but this +// test restarts a shard, so the cached connection is not usable. +TestData.skipCheckingUUIDsConsistentAcrossCluster = true; + (function() { "use strict"; |