summaryrefslogtreecommitdiff
path: root/src/mongo/db/query
diff options
context:
space:
mode:
authorBlake Oler <blake.oler@mongodb.com>2022-10-25 13:41:42 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-10-25 16:37:00 +0000
commit70b0cf6c18648eb6babcae89dbedd05a1b5182e4 (patch)
treeb772f569dc1d324a3742c699bbaf75f46df7cd6a /src/mongo/db/query
parentba8f9a28c8769dfe10f73b190c943ee4a57ee7a1 (diff)
downloadmongo-70b0cf6c18648eb6babcae89dbedd05a1b5182e4.tar.gz
SERVER-54284 ExceptionFor<ErrorCodes::WriteConflict> should resolve to WriteConflictException
Diffstat (limited to 'src/mongo/db/query')
-rw-r--r--src/mongo/db/query/SConscript2
-rw-r--r--src/mongo/db/query/plan_executor_impl.cpp5
-rw-r--r--src/mongo/db/query/plan_yield_policy.cpp4
-rw-r--r--src/mongo/db/query/wildcard_multikey_paths.cpp2
4 files changed, 6 insertions, 7 deletions
diff --git a/src/mongo/db/query/SConscript b/src/mongo/db/query/SConscript
index dad8a374ddb..eeb14270b49 100644
--- a/src/mongo/db/query/SConscript
+++ b/src/mongo/db/query/SConscript
@@ -302,7 +302,7 @@ env.Library(
'$BUILD_DIR/mongo/util/fail_point',
],
LIBDEPS_PRIVATE=[
- '$BUILD_DIR/mongo/db/concurrency/write_conflict_exception',
+ '$BUILD_DIR/mongo/db/concurrency/exception_util',
'$BUILD_DIR/mongo/db/storage/recovery_unit_base',
],
)
diff --git a/src/mongo/db/query/plan_executor_impl.cpp b/src/mongo/db/query/plan_executor_impl.cpp
index 241b52ed58f..87c72b866f8 100644
--- a/src/mongo/db/query/plan_executor_impl.cpp
+++ b/src/mongo/db/query/plan_executor_impl.cpp
@@ -37,7 +37,7 @@
#include "mongo/bson/simple_bsonobj_comparator.h"
#include "mongo/db/catalog/collection.h"
-#include "mongo/db/concurrency/write_conflict_exception.h"
+#include "mongo/db/concurrency/exception_util.h"
#include "mongo/db/curop.h"
#include "mongo/db/exec/cached_plan.h"
#include "mongo/db/exec/collection_scan.h"
@@ -419,8 +419,7 @@ PlanExecutor::ExecState PlanExecutorImpl::_getNextImpl(Snapshotted<Document>* ob
CurOp::get(_opCtx)->debug().additiveMetrics.incrementWriteConflicts(1);
writeConflictsInARow++;
- WriteConflictException::logAndBackoff(
- writeConflictsInARow, "plan execution", _nss.ns());
+ logWriteConflictAndBackoff(writeConflictsInARow, "plan execution", _nss.ns());
// If we're allowed to, we will yield next time through the loop.
if (_yieldPolicy->canAutoYield()) {
diff --git a/src/mongo/db/query/plan_yield_policy.cpp b/src/mongo/db/query/plan_yield_policy.cpp
index 2bfdc055d79..e15f5d8b86a 100644
--- a/src/mongo/db/query/plan_yield_policy.cpp
+++ b/src/mongo/db/query/plan_yield_policy.cpp
@@ -32,7 +32,7 @@
#include "mongo/db/query/plan_yield_policy.h"
#include "mongo/db/catalog/collection.h"
-#include "mongo/db/concurrency/write_conflict_exception.h"
+#include "mongo/db/concurrency/exception_util.h"
#include "mongo/db/operation_context.h"
#include "mongo/util/scopeguard.h"
#include "mongo/util/time_support.h"
@@ -114,7 +114,7 @@ Status PlanYieldPolicy::yieldOrInterrupt(OperationContext* opCtx,
if (_callbacks) {
_callbacks->handledWriteConflict(opCtx);
}
- WriteConflictException::logAndBackoff(attempt, "query yield", ""_sd);
+ logWriteConflictAndBackoff(attempt, "query yield", ""_sd);
// Retry the yielding process.
} catch (...) {
// Errors other than write conflicts don't get retried, and should instead result in
diff --git a/src/mongo/db/query/wildcard_multikey_paths.cpp b/src/mongo/db/query/wildcard_multikey_paths.cpp
index fb27c8b34f5..eea11ccd4b5 100644
--- a/src/mongo/db/query/wildcard_multikey_paths.cpp
+++ b/src/mongo/db/query/wildcard_multikey_paths.cpp
@@ -31,7 +31,7 @@
#include "mongo/db/query/wildcard_multikey_paths.h"
-#include "mongo/db/concurrency/write_conflict_exception.h"
+#include "mongo/db/concurrency/exception_util.h"
#include "mongo/db/index/wildcard_access_method.h"
#include "mongo/db/query/index_bounds_builder.h"
#include "mongo/db/record_id_helpers.h"