diff options
author | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2021-09-20 22:56:56 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-09-20 23:11:25 +0000 |
commit | 9923a9019d2798e06e5bef0a70410eb85cd01e7d (patch) | |
tree | ad343198a7ebfb312d1ed82389d444246fae1d80 | |
parent | 4ef58d7c0b03435f5a6b773998296a65f71677b2 (diff) | |
download | mongo-9923a9019d2798e06e5bef0a70410eb85cd01e7d.tar.gz |
Revert "SERVER-55648 Return correct response in case of shutdown"
This reverts commit 211007fa4a705c02e7c373dd6fc148aa4de3a038.
3 files changed, 0 insertions, 66 deletions
diff --git a/buildscripts/resmokeconfig/suites/sharding_last_stable_mongos_and_mixed_shards.yml b/buildscripts/resmokeconfig/suites/sharding_last_stable_mongos_and_mixed_shards.yml index a63bac55d57..392607b4af9 100644 --- a/buildscripts/resmokeconfig/suites/sharding_last_stable_mongos_and_mixed_shards.yml +++ b/buildscripts/resmokeconfig/suites/sharding_last_stable_mongos_and_mixed_shards.yml @@ -132,8 +132,6 @@ selector: - jstests/sharding/safe_secondary_reads_causal_consistency.js # Enable the following once SERVER-55725 is backported to 4.0 (and prev. versions checked here). - jstests/sharding/time_zone_info_mongos.js - # Requires behavior that does not and will never exist in 3.6. - - jstests/sharding/retryable_mongos_write_errors.js executor: config: shell_options: diff --git a/jstests/sharding/retryable_mongos_write_errors.js b/jstests/sharding/retryable_mongos_write_errors.js deleted file mode 100644 index 6d10f1c4f14..00000000000 --- a/jstests/sharding/retryable_mongos_write_errors.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Tests that retryable write errors in MongoS return a top level error message. - */ - -(function() { - "use strict"; - - load("jstests/libs/fail_point_util.js"); - load('jstests/libs/parallelTester.js'); // for ScopedThread. - - // Creates a new connection, uses it to get the database from the parameter name and inserts - // multiple documents to the provided collection. - function insertHandler(host, databaseName, collectionName) { - const conn = new Mongo(host); - const database = conn.getDB(databaseName); - // creates an array with 10 documents - const docs = Array.from(Array(10).keys()).map((i) => ({a: i, b: "retryable"})); - return database.runCommand({insert: collectionName, documents: docs}); - } - - const dbName = "test"; - const collName = "retryable_mongos_write_errors"; - const ns = dbName + "." + collName; - - const st = new ShardingTest({config: 1, mongos: 1, shards: 1}); - const shard0Primary = st.rs0.getPrimary(); - - const insertFailPoint = - configureFailPoint(shard0Primary, "hangAfterCollectionInserts", {collectionNS: ns}); - - const insertThread = new Thread(insertHandler, st.s.host, dbName, collName); - jsTest.log("Starting To Insert Documents"); - insertThread.start(); - insertFailPoint.wait(); - MongoRunner.stopMongos(st.s); - - try { - const commandResponse = insertThread.returnData(); - jsTest.log("Command Response: " + tojson(commandResponse) + "." + commandResponse.code); - // assert that retryableInsertRes failed with the HostUnreachableError or - // InterruptedAtShutdown error code - assert.eq(commandResponse.code, ErrorCodes.InterruptedAtShutdown, tojson(commandResponse)); - } catch (e) { - jsTest.log("Error ocurred: " + e); - if (!isNetworkError(e)) { - throw e; - } - } - - jsTest.log("Finished Assertions, Turning Off Failpoint"); - - insertFailPoint.off(); - st.s = MongoRunner.runMongos(st.s); - - jsTest.log('Shutting down sharding test'); - st.stop(); -}());
\ No newline at end of file diff --git a/src/mongo/s/write_ops/batch_write_exec.cpp b/src/mongo/s/write_ops/batch_write_exec.cpp index bf2dfbe912b..54bfdf6572f 100644 --- a/src/mongo/s/write_ops/batch_write_exec.cpp +++ b/src/mongo/s/write_ops/batch_write_exec.cpp @@ -46,7 +46,6 @@ #include "mongo/s/grid.h" #include "mongo/s/write_ops/batch_write_op.h" #include "mongo/s/write_ops/write_error_detail.h" -#include "mongo/util/exit.h" #include "mongo/util/log.h" namespace mongo { @@ -304,12 +303,6 @@ void BatchWriteExec::executeBatch(OperationContext* opCtx, : OID()); } else { // Error occurred dispatching, note it - if (ErrorCodes::isShutdownError(responseStatus.code()) && - globalInShutdownDeprecated()) { - // Throw an error since the mongos itself is shutting down so this should - // be a top level error instead of a write error. - uassertStatusOK(responseStatus); - } const Status status = responseStatus.withContext( str::stream() << "Write results unavailable from " << shardHost); |