summaryrefslogtreecommitdiff
path: root/src/mongo/s/write_ops/batched_command_request.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/write_ops/batched_command_request.cpp')
-rw-r--r--src/mongo/s/write_ops/batched_command_request.cpp32
1 files changed, 3 insertions, 29 deletions
diff --git a/src/mongo/s/write_ops/batched_command_request.cpp b/src/mongo/s/write_ops/batched_command_request.cpp
index e6b3c970592..185857d6acc 100644
--- a/src/mongo/s/write_ops/batched_command_request.cpp
+++ b/src/mongo/s/write_ops/batched_command_request.cpp
@@ -38,8 +38,6 @@
namespace mongo {
namespace {
-const auto kWriteConcern = "writeConcern"_sd;
-
template <class T>
BatchedCommandRequest constructBatchedCommandRequest(const OpMsgRequest& request) {
auto batchRequest = BatchedCommandRequest{T::parse(request)};
@@ -53,16 +51,6 @@ BatchedCommandRequest constructBatchedCommandRequest(const OpMsgRequest& request
batchRequest.setShardVersion(shardVersion);
}
- auto writeConcernField = request.body[kWriteConcern];
- if (!writeConcernField.eoo()) {
- auto wcObj = writeConcernField.Obj();
- // Client write concerns without 'w' fields should be filled with the default write concern,
- // which should be populated later to the operation context during the command setup phase.
- if (wcObj.hasElement("w")) {
- batchRequest.setWriteConcern(wcObj);
- }
- }
-
// The 'isTimeseriesNamespace' is an internal parameter used for communication between mongos
// and mongod.
auto isTimeseriesNamespace =
@@ -178,19 +166,9 @@ const boost::optional<BSONObj>& BatchedCommandRequest::getLet() const {
return _visit(Visitor{});
};
-bool BatchedCommandRequest::requiresWriteAcknowledgement() const {
- if (!hasWriteConcern()) {
- return true;
- }
-
- BSONObj writeConcern = getWriteConcern();
- BSONElement wElem = writeConcern["w"];
- if (!wElem.isNumber() || wElem.Number() != 0) {
- return true;
- }
-
- return false;
-}
+const OptionalBool& BatchedCommandRequest::getBypassEmptyTsReplacement() const {
+ return _visit([](auto&& op) -> decltype(auto) { return op.getBypassEmptyTsReplacement(); });
+};
const write_ops::WriteCommandRequestBase& BatchedCommandRequest::getWriteCommandRequestBase()
const {
@@ -211,10 +189,6 @@ void BatchedCommandRequest::serialize(BSONObjBuilder* builder) const {
if (_dbVersion) {
builder->append("databaseVersion", _dbVersion->toBSON());
}
-
- if (_writeConcern) {
- builder->append(kWriteConcern, *_writeConcern);
- }
}
BSONObj BatchedCommandRequest::toBSON() const {