summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorPavi Vetriselvan <pavithra.vetriselvan@mongodb.com>2021-04-21 10:42:44 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-05-07 05:07:15 +0000
commitd8a0fa7c0dd64e01a83fd45b63a2616164f2c019 (patch)
tree027c53326ea5e357854ed96603b2766f898a6ed0 /src/mongo/db
parent58817e04308cbea4aa7627005cb5aaadd32c89fe (diff)
downloadmongo-d8a0fa7c0dd64e01a83fd45b63a2616164f2c019.tar.gz
SERVER-55788 Deprecate legacy wire protocol opcodes
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/commands/get_last_error.cpp3
-rw-r--r--src/mongo/db/service_entry_point_common.cpp4
2 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/commands/get_last_error.cpp b/src/mongo/db/commands/get_last_error.cpp
index f2b97a08efd..7cc13764c65 100644
--- a/src/mongo/db/commands/get_last_error.cpp
+++ b/src/mongo/db/commands/get_last_error.cpp
@@ -42,6 +42,7 @@
#include "mongo/db/write_concern.h"
#include "mongo/idl/command_generic_argument.h"
#include "mongo/logv2/log.h"
+#include "mongo/rpc/warn_deprecated_wire_ops.h"
namespace mongo {
namespace {
@@ -119,6 +120,8 @@ public:
}
}
+ warnDeprecation(c, "getLastError");
+
// for sharding; also useful in general for debugging
result.appendNumber("connectionId", c.getConnectionId());
diff --git a/src/mongo/db/service_entry_point_common.cpp b/src/mongo/db/service_entry_point_common.cpp
index abf81db6275..e60c89a3b65 100644
--- a/src/mongo/db/service_entry_point_common.cpp
+++ b/src/mongo/db/service_entry_point_common.cpp
@@ -99,6 +99,7 @@
#include "mongo/rpc/metadata/tracking_metadata.h"
#include "mongo/rpc/op_msg.h"
#include "mongo/rpc/reply_builder_interface.h"
+#include "mongo/rpc/warn_deprecated_wire_ops.h"
#include "mongo/s/shard_cannot_refresh_due_to_locks_held_exception.h"
#include "mongo/transport/hello_metrics.h"
#include "mongo/transport/service_executor.h"
@@ -1958,6 +1959,7 @@ DbResponse receivedQuery(OperationContext* opCtx,
DbResponse dbResponse;
try {
+ warnDeprecation(c, networkOpToString(m.operation()));
Client* client = opCtx->getClient();
Status status = auth::checkAuthForFind(AuthorizationSession::get(client), nss, false);
audit::logQueryAuthzCheck(client, nss, q.query, status.code());
@@ -2094,6 +2096,7 @@ DbResponse receivedGetMore(OperationContext* opCtx,
DbResponse dbresponse;
try {
+ warnDeprecation(*opCtx->getClient(), networkOpToString(m.operation()));
const NamespaceString nsString(ns);
uassert(ErrorCodes::InvalidNamespace,
str::stream() << "Invalid ns [" << ns << "]",
@@ -2280,6 +2283,7 @@ std::unique_ptr<HandleRequest::OpRunner> HandleRequest::makeOpRunner() {
DbResponse FireAndForgetOpRunner::runSync() {
try {
+ warnDeprecation(executionContext->client(), networkOpToString(executionContext->op()));
runAndForget();
} catch (const AssertionException& ue) {
LastError::get(executionContext->client()).setLastError(ue.code(), ue.reason());