summaryrefslogtreecommitdiff
path: root/src/mongo/s/write_ops/batch_write_op.cpp
diff options
context:
space:
mode:
authorLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-18 17:02:53 -0300
committerLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-18 17:02:53 -0300
commit959575a5ca598bf5f37fb5cebe7ed1d80d3d71f7 (patch)
treeacc8d60aedb12b70048e676e8a7349deb0010db8 /src/mongo/s/write_ops/batch_write_op.cpp
parent76588293975fc059cf076779e4283e6ffaf8afff (diff)
New upstream version 6.0.20upstream
Diffstat (limited to 'src/mongo/s/write_ops/batch_write_op.cpp')
-rw-r--r--src/mongo/s/write_ops/batch_write_op.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/mongo/s/write_ops/batch_write_op.cpp b/src/mongo/s/write_ops/batch_write_op.cpp
index f93e5302e4f..ed67f6c0088 100644
--- a/src/mongo/s/write_ops/batch_write_op.cpp
+++ b/src/mongo/s/write_ops/batch_write_op.cpp
@@ -568,6 +568,9 @@ BatchedCommandRequest BatchWriteOp::buildBatchRequest(const TargetedWriteBatch&
wcb.setStmtIds(std::move(stmtIdsForOp));
}
+ wcb.setBypassEmptyTsReplacement(
+ _clientRequest.getWriteCommandRequestBase().getBypassEmptyTsReplacement());
+
return wcb;
}());
@@ -580,19 +583,6 @@ BatchedCommandRequest BatchWriteOp::buildBatchRequest(const TargetedWriteBatch&
if (dbVersion)
request.setDbVersion(*dbVersion);
- if (_clientRequest.hasWriteConcern()) {
- if (_clientRequest.requiresWriteAcknowledgement()) {
- request.setWriteConcern(_clientRequest.getWriteConcern());
- } else {
- // Mongos needs to send to the shard with w > 0 so it will be able to see the
- // writeErrors
- request.setWriteConcern(upgradeWriteConcern(_clientRequest.getWriteConcern()));
- }
- } else if (!TransactionRouter::get(_opCtx)) {
- // Apply the WC from the opCtx (except if in a transaction).
- request.setWriteConcern(_opCtx->getWriteConcern().toBSON());
- }
-
return request;
}