summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaria van Keulen <maria.vankeulen@mongodb.com>2020-01-16 20:14:45 +0000
committerA. Jesse Jiryu Davis <jesse@mongodb.com>2020-01-27 15:40:35 -0500
commit8122c12968dda7d9ab0f982bd6177e48dde3a123 (patch)
tree8ccc0013cf5bab55dfe71d2d6192494e0f4fe5fb
parent9cd4690536ef82a7a163943e727f94a7e9cb006c (diff)
downloadmongo-8122c12968dda7d9ab0f982bd6177e48dde3a123.tar.gz
SERVER-45112 Report error labels for cluster create indexes responses
-rw-r--r--buildscripts/resmokeconfig/suites/concurrency_sharded_multi_stmt_txn_kill_primary.yml6
-rw-r--r--buildscripts/resmokeconfig/suites/concurrency_sharded_multi_stmt_txn_terminate_primary.yml6
-rw-r--r--buildscripts/resmokeconfig/suites/concurrency_sharded_multi_stmt_txn_with_stepdowns.yml6
-rw-r--r--src/mongo/s/cluster_commands_helpers.cpp10
4 files changed, 10 insertions, 18 deletions
diff --git a/buildscripts/resmokeconfig/suites/concurrency_sharded_multi_stmt_txn_kill_primary.yml b/buildscripts/resmokeconfig/suites/concurrency_sharded_multi_stmt_txn_kill_primary.yml
index 7c64f339788..10b621597d3 100644
--- a/buildscripts/resmokeconfig/suites/concurrency_sharded_multi_stmt_txn_kill_primary.yml
+++ b/buildscripts/resmokeconfig/suites/concurrency_sharded_multi_stmt_txn_kill_primary.yml
@@ -209,12 +209,6 @@ selector:
- jstests/concurrency/fsm_workloads/remove_where.js
- jstests/concurrency/fsm_workloads/update_where.js
- # These workloads use the createIndexes command and are not resilient to HostUnreachable
- # and InterruptedDueToReplStateChange errors induced by this suite.
- # TODO Unblacklist (SERVER-45112).
- - jstests/concurrency/fsm_workloads/create_index_background_unique.js
- - jstests/concurrency/fsm_workloads/create_index_background_unique_capped.js
-
exclude_with_any_tags:
- requires_replication
# Sharing cursors between state functions will fail in this suite because it will attempt to use
diff --git a/buildscripts/resmokeconfig/suites/concurrency_sharded_multi_stmt_txn_terminate_primary.yml b/buildscripts/resmokeconfig/suites/concurrency_sharded_multi_stmt_txn_terminate_primary.yml
index 25350ecef3e..e33d5ddbf5d 100644
--- a/buildscripts/resmokeconfig/suites/concurrency_sharded_multi_stmt_txn_terminate_primary.yml
+++ b/buildscripts/resmokeconfig/suites/concurrency_sharded_multi_stmt_txn_terminate_primary.yml
@@ -209,12 +209,6 @@ selector:
- jstests/concurrency/fsm_workloads/remove_where.js
- jstests/concurrency/fsm_workloads/update_where.js
- # These workloads use the createIndexes command and are not resilient to HostUnreachable
- # and InterruptedDueToReplStateChange errors induced by this suite.
- # TODO Unblacklist (SERVER-45112).
- - jstests/concurrency/fsm_workloads/create_index_background_unique.js
- - jstests/concurrency/fsm_workloads/create_index_background_unique_capped.js
-
exclude_with_any_tags:
- requires_replication
# Sharing cursors between state functions will fail in this suite because it will attempt to use
diff --git a/buildscripts/resmokeconfig/suites/concurrency_sharded_multi_stmt_txn_with_stepdowns.yml b/buildscripts/resmokeconfig/suites/concurrency_sharded_multi_stmt_txn_with_stepdowns.yml
index 6e0b9f86f1f..e2c24ba992f 100644
--- a/buildscripts/resmokeconfig/suites/concurrency_sharded_multi_stmt_txn_with_stepdowns.yml
+++ b/buildscripts/resmokeconfig/suites/concurrency_sharded_multi_stmt_txn_with_stepdowns.yml
@@ -191,12 +191,6 @@ selector:
- jstests/concurrency/fsm_workloads/remove_where.js
- jstests/concurrency/fsm_workloads/update_where.js
- # These workloads use the createIndexes command and are not resilient to HostUnreachable
- # and InterruptedDueToReplStateChange errors induced by this suite.
- # TODO Unblacklist (SERVER-45112).
- - jstests/concurrency/fsm_workloads/create_index_background_unique.js
- - jstests/concurrency/fsm_workloads/create_index_background_unique_capped.js
-
exclude_with_any_tags:
- does_not_support_causal_consistency
- requires_replication
diff --git a/src/mongo/s/cluster_commands_helpers.cpp b/src/mongo/s/cluster_commands_helpers.cpp
index 7d80604743a..b52daddc718 100644
--- a/src/mongo/s/cluster_commands_helpers.cpp
+++ b/src/mongo/s/cluster_commands_helpers.cpp
@@ -38,6 +38,7 @@
#include "mongo/bson/util/bson_extract.h"
#include "mongo/db/commands.h"
#include "mongo/db/curop.h"
+#include "mongo/db/error_labels.h"
#include "mongo/db/logical_clock.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/query/cursor_response.h"
@@ -446,6 +447,15 @@ bool appendRawResponses(OperationContext* opCtx,
const auto processError = [&](const ShardId& shardId, const Status& status) {
invariant(!status.isOK());
+ // It is safe to pass `hasWriteConcernError` as false in the below check because operations
+ // run inside transactions do not wait for write concern, except for commit and abort.
+ if (TransactionRouter::get(opCtx) &&
+ isTransientTransactionError(
+ status.code(), false /*hasWriteConcernError*/, false /*isCommitOrAbort*/)) {
+ // Re-throw on transient transaction errors to make sure appropriate error labels are
+ // appended to the result.
+ uassertStatusOK(status);
+ }
if (ignorableErrors.find(status.code()) != ignorableErrors.end()) {
ignorableErrorsReceived.emplace_back(std::move(shardId), std::move(status));
return;