summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/cluster_write_cmd.cpp
diff options
context:
space:
mode:
authorJanna Golden <janna.golden@mongodb.com>2019-09-20 15:17:37 +0000
committerevergreen <evergreen@mongodb.com>2019-09-20 15:17:37 +0000
commitb21c2f2741682591b925841aea131bc3dce3de9a (patch)
tree7f999b983f739df3dc40b8ca0f5dab7c29e39973 /src/mongo/s/commands/cluster_write_cmd.cpp
parent3518ecd5b9eeb40c4191749503b79ec0ff752c52 (diff)
downloadmongo-b21c2f2741682591b925841aea131bc3dce3de9a.tar.gz
SERVER-43337 Check that txn writes are successful before attempting to commit an update to shard key
Diffstat (limited to 'src/mongo/s/commands/cluster_write_cmd.cpp')
-rw-r--r--src/mongo/s/commands/cluster_write_cmd.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mongo/s/commands/cluster_write_cmd.cpp b/src/mongo/s/commands/cluster_write_cmd.cpp
index 6fd2853dcba..eb67cdc089f 100644
--- a/src/mongo/s/commands/cluster_write_cmd.cpp
+++ b/src/mongo/s/commands/cluster_write_cmd.cpp
@@ -220,6 +220,8 @@ bool handleWouldChangeOwningShardError(OperationContext* opCtx,
ClusterWriter::write(opCtx, request, &stats, response);
wouldChangeOwningShardErrorInfo =
getWouldChangeOwningShardErrorInfo(opCtx, request, response, !isRetryableWrite);
+ if (!wouldChangeOwningShardErrorInfo)
+ uassertStatusOK(response->toStatus());
// If we do not get WouldChangeOwningShard when re-running the update, the document has
// been modified or deleted concurrently and we do not need to delete it and insert a