summaryrefslogtreecommitdiff
path: root/src/mongo/shell/bench.cpp
diff options
context:
space:
mode:
authorIrina Yatsenko <irina.yatsenko@mongodb.com>2021-07-02 05:04:38 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-07-03 02:59:55 +0000
commitfde0540020340768e8a459633f57e3e23cabea3d (patch)
tree91541e38a8b3ec6ad19ddf6f80f39d8a6cca181b /src/mongo/shell/bench.cpp
parentde197ff4ea6c7e990e650e716839ef72efc0c391 (diff)
downloadmongo-fde0540020340768e8a459633f57e3e23cabea3d.tar.gz
SERVER-57389 Remove GLE helpers from the shell and dbclient
Diffstat (limited to 'src/mongo/shell/bench.cpp')
-rw-r--r--src/mongo/shell/bench.cpp46
1 files changed, 19 insertions, 27 deletions
diff --git a/src/mongo/shell/bench.cpp b/src/mongo/shell/bench.cpp
index 4e0d37529f7..6afd6705a14 100644
--- a/src/mongo/shell/bench.cpp
+++ b/src/mongo/shell/bench.cpp
@@ -1288,34 +1288,26 @@ void BenchRunOp::executeOnce(DBClientBase* conn,
{
BenchRunEventTrace _bret(&state->stats->deleteCounter);
BSONObj predicate = fixQuery(this->query, *state->bsonTemplateEvaluator);
- if (this->useWriteCmd) {
- BSONObjBuilder builder;
- builder.append("delete", nsToCollectionSubstring(this->ns));
- BSONArrayBuilder docBuilder(builder.subarrayStart("deletes"));
- int limit = (this->multi == true) ? 0 : 1;
- docBuilder.append(BSON("q" << predicate << "limit" << limit));
- docBuilder.done();
- builder.append("writeConcern", this->writeConcern);
-
- boost::optional<TxnNumber> txnNumberForOp;
- if (config.useIdempotentWrites) {
- ++state->txnNumber;
- txnNumberForOp = state->txnNumber;
- }
- runCommandWithSession(conn,
- nsToDatabaseSubstring(this->ns).toString(),
- builder.done(),
- kNoOptions,
- lsid,
- txnNumberForOp,
- &result);
- } else {
- auto toSend = makeRemoveMessage(
- this->ns, predicate, this->multi ? 0 : RemoveOption_JustOne);
- conn->say(toSend);
- if (this->safe)
- result = conn->getLastErrorDetailed();
+ BSONObjBuilder builder;
+ builder.append("delete", nsToCollectionSubstring(this->ns));
+ BSONArrayBuilder docBuilder(builder.subarrayStart("deletes"));
+ int limit = (this->multi == true) ? 0 : 1;
+ docBuilder.append(BSON("q" << predicate << "limit" << limit));
+ docBuilder.done();
+ builder.append("writeConcern", this->writeConcern);
+
+ boost::optional<TxnNumber> txnNumberForOp;
+ if (config.useIdempotentWrites) {
+ ++state->txnNumber;
+ txnNumberForOp = state->txnNumber;
}
+ runCommandWithSession(conn,
+ nsToDatabaseSubstring(this->ns).toString(),
+ builder.done(),
+ kNoOptions,
+ lsid,
+ txnNumberForOp,
+ &result);
}
if (this->safe) {