summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorHari Khalsa <hkhalsa@10gen.com>2014-09-11 15:31:21 -0400
committerHari Khalsa <hkhalsa@10gen.com>2014-09-11 16:21:29 -0400
commit1a90996313ec83f0913bf2aef322193b0884f499 (patch)
tree8c93a84b2a7c3fbbedadd7e34c8c9ffd07b9eea7 /src/mongo/db
parentb6e5d1e2af49ebb2edfb6522ba744d344b73c4f6 (diff)
downloadmongo-1a90996313ec83f0913bf2aef322193b0884f499.tar.gz
SERVER-14668 split dbdirectclient out of instance.cpp
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/auth/authz_manager_external_state_d.cpp2
-rw-r--r--src/mongo/db/cloner.cpp2
-rw-r--r--src/mongo/db/commands/apply_ops.cpp7
-rw-r--r--src/mongo/db/commands/drop_indexes.cpp2
-rw-r--r--src/mongo/db/commands/find_and_modify.cpp3
-rw-r--r--src/mongo/db/commands/mr.h2
-rw-r--r--src/mongo/db/db.cpp1
-rw-r--r--src/mongo/db/dbcommands.cpp1
-rw-r--r--src/mongo/db/dbdirectclient.cpp197
-rw-r--r--src/mongo/db/dbdirectclient.h110
-rw-r--r--src/mongo/db/instance.cpp86
-rw-r--r--src/mongo/db/instance.h65
-rw-r--r--src/mongo/db/pipeline/pipeline_d.cpp2
-rw-r--r--src/mongo/db/repl/master_slave.cpp2
-rw-r--r--src/mongo/db/repl/oplog.cpp2
-rw-r--r--src/mongo/db/repl/rs_config.cpp2
-rw-r--r--src/mongo/db/restapi.cpp2
-rw-r--r--src/mongo/db/ttl.cpp4
18 files changed, 327 insertions, 165 deletions
diff --git a/src/mongo/db/auth/authz_manager_external_state_d.cpp b/src/mongo/db/auth/authz_manager_external_state_d.cpp
index 84798ef6d40..0d67973624d 100644
--- a/src/mongo/db/auth/authz_manager_external_state_d.cpp
+++ b/src/mongo/db/auth/authz_manager_external_state_d.cpp
@@ -41,8 +41,8 @@
#include "mongo/db/auth/user_name.h"
#include "mongo/db/client.h"
#include "mongo/db/dbhelpers.h"
+#include "mongo/db/dbdirectclient.h"
#include "mongo/db/global_environment_experiment.h"
-#include "mongo/db/instance.h"
#include "mongo/db/jsobj.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/storage/storage_engine.h"
diff --git a/src/mongo/db/cloner.cpp b/src/mongo/db/cloner.cpp
index bf60bd3ace9..8861ff4442e 100644
--- a/src/mongo/db/cloner.cpp
+++ b/src/mongo/db/cloner.cpp
@@ -45,9 +45,9 @@
#include "mongo/db/commands.h"
#include "mongo/db/commands/copydb.h"
#include "mongo/db/commands/rename_collection.h"
+#include "mongo/db/dbdirectclient.h"
#include "mongo/db/dbhelpers.h"
#include "mongo/db/index_builder.h"
-#include "mongo/db/instance.h"
#include "mongo/db/jsobj.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/repl/isself.h"
diff --git a/src/mongo/db/commands/apply_ops.cpp b/src/mongo/db/commands/apply_ops.cpp
index e4901cd303d..34e8bceeb17 100644
--- a/src/mongo/db/commands/apply_ops.cpp
+++ b/src/mongo/db/commands/apply_ops.cpp
@@ -35,13 +35,14 @@
#include "mongo/db/auth/authorization_session.h"
#include "mongo/db/auth/privilege.h"
#include "mongo/db/auth/resource_pattern.h"
-#include "mongo/db/jsobj.h"
+#include "mongo/db/client.h"
#include "mongo/db/commands.h"
#include "mongo/db/commands/dbhash.h"
-#include "mongo/db/instance.h"
+#include "mongo/db/dbdirectclient.h"
+#include "mongo/db/jsobj.h"
#include "mongo/db/matcher/matcher.h"
-#include "mongo/db/repl/oplog.h"
#include "mongo/db/operation_context_impl.h"
+#include "mongo/db/repl/oplog.h"
namespace mongo {
class ApplyOpsCmd : public Command {
diff --git a/src/mongo/db/commands/drop_indexes.cpp b/src/mongo/db/commands/drop_indexes.cpp
index fd3e8e6b57e..ba93d95bc54 100644
--- a/src/mongo/db/commands/drop_indexes.cpp
+++ b/src/mongo/db/commands/drop_indexes.cpp
@@ -37,9 +37,9 @@
#include "mongo/db/background.h"
#include "mongo/db/commands.h"
+#include "mongo/db/dbdirectclient.h"
#include "mongo/db/index_builder.h"
#include "mongo/db/index/index_descriptor.h"
-#include "mongo/db/instance.h"
#include "mongo/db/catalog/collection.h"
#include "mongo/db/catalog/collection_catalog_entry.h"
#include "mongo/db/catalog/database.h"
diff --git a/src/mongo/db/commands/find_and_modify.cpp b/src/mongo/db/commands/find_and_modify.cpp
index 2e3bbb7969d..4477e62bec0 100644
--- a/src/mongo/db/commands/find_and_modify.cpp
+++ b/src/mongo/db/commands/find_and_modify.cpp
@@ -34,10 +34,11 @@
#include "mongo/db/commands/find_and_modify.h"
+#include "mongo/db/client.h"
#include "mongo/db/clientcursor.h"
#include "mongo/db/commands.h"
+#include "mongo/db/dbdirectclient.h"
#include "mongo/db/dbhelpers.h"
-#include "mongo/db/instance.h"
#include "mongo/db/projection.h"
#include "mongo/db/ops/delete.h"
#include "mongo/db/ops/update.h"
diff --git a/src/mongo/db/commands/mr.h b/src/mongo/db/commands/mr.h
index 0566d60bb60..404e6a24072 100644
--- a/src/mongo/db/commands/mr.h
+++ b/src/mongo/db/commands/mr.h
@@ -36,7 +36,7 @@
#include "mongo/db/auth/privilege.h"
#include "mongo/db/curop.h"
-#include "mongo/db/instance.h"
+#include "mongo/db/dbdirectclient.h"
#include "mongo/db/jsobj.h"
#include "mongo/platform/atomic_word.h"
#include "mongo/scripting/engine.h"
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp
index add54ab935e..e5b013ffc68 100644
--- a/src/mongo/db/db.cpp
+++ b/src/mongo/db/db.cpp
@@ -53,6 +53,7 @@
#include "mongo/db/commands/server_status_metric.h"
#include "mongo/db/concurrency/d_concurrency.h"
#include "mongo/db/db.h"
+#include "mongo/db/dbdirectclient.h"
#include "mongo/db/dbmessage.h"
#include "mongo/db/dbwebserver.h"
#include "mongo/db/global_environment_d.h"
diff --git a/src/mongo/db/dbcommands.cpp b/src/mongo/db/dbcommands.cpp
index ec08a4989a5..a2cce53daba 100644
--- a/src/mongo/db/dbcommands.cpp
+++ b/src/mongo/db/dbcommands.cpp
@@ -54,6 +54,7 @@
#include "mongo/db/commands/server_status.h"
#include "mongo/db/commands/shutdown.h"
#include "mongo/db/db.h"
+#include "mongo/db/dbdirectclient.h"
#include "mongo/db/dbhelpers.h"
#include "mongo/db/global_environment_d.h"
#include "mongo/db/index_builder.h"
diff --git a/src/mongo/db/dbdirectclient.cpp b/src/mongo/db/dbdirectclient.cpp
new file mode 100644
index 00000000000..7d43034ad58
--- /dev/null
+++ b/src/mongo/db/dbdirectclient.cpp
@@ -0,0 +1,197 @@
+/**
+ * Copyright (C) 2014 MongoDB Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the GNU Affero General Public License in all respects for
+ * all of the code used other than as permitted herein. If you modify file(s)
+ * with this exception, you may extend this exception to your version of the
+ * file(s), but you are not obligated to do so. If you do not wish to do so,
+ * delete this exception statement from your version. If you delete this
+ * exception statement from all source files in the program, then also delete
+ * it in the license file.
+ */
+
+#include "mongo/db/dbdirectclient.h"
+
+#include "mongo/db/client.h"
+#include "mongo/db/commands/count.h"
+#include "mongo/db/instance.h"
+#include "mongo/db/operation_context.h"
+#include "mongo/util/log.h"
+
+namespace mongo {
+
+ // Called from scripting/engine.cpp and scripting/v8_db.cpp.
+ DBClientBase* createDirectClient(OperationContext* txn) {
+ return new DBDirectClient(txn);
+ }
+
+ namespace {
+
+ class GodScope {
+ MONGO_DISALLOW_COPYING(GodScope);
+ public:
+ GodScope(OperationContext* txn) : _txn(txn) {
+ _prev = _txn->getClient()->setGod(true);
+ }
+
+ ~GodScope() {
+ _txn->getClient()->setGod(_prev);
+ }
+
+ private:
+ bool _prev;
+ OperationContext* _txn;
+ };
+
+ } // namespace
+
+
+ DBDirectClient::DBDirectClient(OperationContext* txn) : _txn(txn) { }
+
+ bool DBDirectClient::isFailed() const {
+ return false;
+ }
+
+ bool DBDirectClient::isStillConnected() {
+ return true;
+ }
+
+ std::string DBDirectClient::toString() const {
+ return "DBDirectClient";
+ }
+
+ std::string DBDirectClient::getServerAddress() const {
+ return "localhost"; // TODO: should this have the port?
+ }
+
+ void DBDirectClient::sayPiggyBack(Message& toSend) {
+ // don't need to piggy back when connected locally
+ return say(toSend);
+ }
+
+ bool DBDirectClient::callRead(Message& toSend, Message& response) {
+ return call(toSend, response);
+ }
+
+ ConnectionString::ConnectionType DBDirectClient::type() const {
+ return ConnectionString::MASTER;
+ }
+
+ double DBDirectClient::getSoTimeout() const {
+ return 0;
+ }
+
+ bool DBDirectClient::lazySupported() const {
+ return true;
+ }
+
+ void DBDirectClient::setOpCtx(OperationContext* txn) {
+ _txn = txn;
+ }
+
+ QueryOptions DBDirectClient::_lookupAvailableOptions() {
+ // Exhaust mode is not available in DBDirectClient.
+ return QueryOptions(DBClientBase::_lookupAvailableOptions() & ~QueryOption_Exhaust);
+ }
+
+ bool DBDirectClient::call(Message& toSend,
+ Message& response,
+ bool assertOk,
+ string* actualServer) {
+
+ GodScope gs(_txn);
+ if (lastError._get()) {
+ lastError.startRequest(toSend, lastError._get());
+ }
+
+ DbResponse dbResponse;
+ assembleResponse(_txn, toSend, dbResponse, dummyHost);
+ verify(dbResponse.response);
+
+ // can get rid of this if we make response handling smarter
+ dbResponse.response->concat();
+ response = *dbResponse.response;
+
+ return true;
+ }
+
+ void DBDirectClient::say(Message& toSend, bool isRetry, string* actualServer) {
+ GodScope gs(_txn);
+ if (lastError._get()) {
+ lastError.startRequest(toSend, lastError._get());
+ }
+
+ DbResponse dbResponse;
+ assembleResponse(_txn, toSend, dbResponse, dummyHost);
+ }
+
+ auto_ptr<DBClientCursor> DBDirectClient::query(const string& ns,
+ Query query,
+ int nToReturn,
+ int nToSkip,
+ const BSONObj* fieldsToReturn,
+ int queryOptions,
+ int batchSize) {
+
+ return DBClientBase::query(ns,
+ query,
+ nToReturn,
+ nToSkip,
+ fieldsToReturn,
+ queryOptions,
+ batchSize);
+ }
+
+ void DBDirectClient::killCursor(long long id) {
+ // The killCursor command on the DB client is only used by sharding,
+ // so no need to have it for MongoD.
+ verify(!"killCursor should not be used in MongoD");
+ }
+
+ const HostAndPort DBDirectClient::dummyHost("0.0.0.0", 0);
+
+ unsigned long long DBDirectClient::count(const string& ns,
+ const BSONObj& query,
+ int options,
+ int limit,
+ int skip) {
+ if (skip < 0) {
+ warning() << "setting negative skip value: " << skip
+ << " to zero in query: " << query << endl;
+ skip = 0;
+ }
+
+ Lock::DBRead lk(_txn->lockState(), ns);
+ string errmsg;
+ int errCode;
+ long long res = runCount(_txn,
+ ns,
+ _countCmd(ns, query, options, limit, skip),
+ errmsg,
+ errCode);
+
+ if (res == -1) {
+ // namespace doesn't exist
+ return 0;
+ }
+ massert(errCode, str::stream() << "count failed in DBDirectClient: " << errmsg , res >= 0);
+ return (unsigned long long )res;
+ }
+
+} // namespace mongo
diff --git a/src/mongo/db/dbdirectclient.h b/src/mongo/db/dbdirectclient.h
new file mode 100644
index 00000000000..0a8b5122dd0
--- /dev/null
+++ b/src/mongo/db/dbdirectclient.h
@@ -0,0 +1,110 @@
+/**
+ * Copyright (C) 2014 MongoDB Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the GNU Affero General Public License in all respects for
+ * all of the code used other than as permitted herein. If you modify file(s)
+ * with this exception, you may extend this exception to your version of the
+ * file(s), but you are not obligated to do so. If you do not wish to do so,
+ * delete this exception statement from your version. If you delete this
+ * exception statement from all source files in the program, then also delete
+ * it in the license file.
+ */
+
+#pragma once
+
+#include "mongo/client/dbclientinterface.h"
+#include "mongo/db/dbmessage.h"
+#include "mongo/util/net/hostandport.h"
+
+namespace mongo {
+
+ class OperationContext;
+
+ /**
+ * Embedded calls to the local server using the DBClientBase API without going over the network.
+ *
+ * Caller does not need to lock, that is handled within.
+ *
+ * All operations are performed within the scope of a passed-in OperationContext (except when
+ * using the deprecated constructor). You must ensure that the OperationContext is valid when
+ * calling into any function. If you ever need to change the OperationContext, that can be done
+ * without the overhead of creating a new DBDirectClient by calling setOpCtx(), after which all
+ * operations will use the new OperationContext.
+ */
+ class DBDirectClient : public DBClientBase {
+ public:
+ static const HostAndPort dummyHost;
+
+ DBDirectClient(OperationContext* txn);
+
+ using DBClientBase::query;
+
+ // XXX: is this valid or useful?
+ void setOpCtx(OperationContext* txn);
+
+ virtual std::auto_ptr<DBClientCursor> query(const std::string &ns,
+ Query query,
+ int nToReturn = 0,
+ int nToSkip = 0,
+ const BSONObj* fieldsToReturn = 0,
+ int queryOptions = 0,
+ int batchSize = 0);
+
+ virtual bool isFailed() const;
+
+ virtual bool isStillConnected();
+
+ virtual std::string toString() const;
+
+ virtual std::string getServerAddress() const;
+
+ virtual bool call(Message& toSend,
+ Message& response,
+ bool assertOk = true,
+ std::string* actualServer = 0);
+
+ virtual void say(Message& toSend,
+ bool isRetry = false,
+ std::string* actualServer = 0);
+
+ virtual void sayPiggyBack(Message& toSend);
+
+ virtual void killCursor(long long cursorID);
+
+ virtual bool callRead(Message& toSend, Message& response);
+
+ virtual unsigned long long count(const std::string &ns,
+ const BSONObj& query = BSONObj(),
+ int options = 0,
+ int limit = 0,
+ int skip = 0);
+
+ virtual ConnectionString::ConnectionType type() const;
+
+ double getSoTimeout() const;
+
+ virtual bool lazySupported() const;
+
+ virtual QueryOptions _lookupAvailableOptions();
+
+ private:
+ OperationContext* _txn;
+ };
+
+} // namespace mongo
diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp
index 3495644750f..3aebe6ca895 100644
--- a/src/mongo/db/instance.cpp
+++ b/src/mongo/db/instance.cpp
@@ -45,6 +45,7 @@
#include "mongo/db/commands/fsync.h"
#include "mongo/db/concurrency/d_concurrency.h"
#include "mongo/db/db.h"
+#include "mongo/db/dbdirectclient.h"
#include "mongo/db/dbhelpers.h"
#include "mongo/db/dbmessage.h"
#include "mongo/db/storage/storage_engine.h"
@@ -921,91 +922,6 @@ namespace mongo {
}
}
- DBDirectClient::DBDirectClient(OperationContext* txn)
- : _txn(txn)
- {}
-
- QueryOptions DBDirectClient::_lookupAvailableOptions() {
- // Exhaust mode is not available in DBDirectClient.
- return QueryOptions(DBClientBase::_lookupAvailableOptions() & ~QueryOption_Exhaust);
- }
-
-namespace {
- class GodScope {
- MONGO_DISALLOW_COPYING(GodScope);
- public:
- GodScope(OperationContext* txn) : _txn(txn) {
- _prev = _txn->getClient()->setGod(true);
- }
- ~GodScope() { _txn->getClient()->setGod(_prev); }
- private:
- bool _prev;
- OperationContext* _txn;
- };
-} // namespace
-
- bool DBDirectClient::call( Message &toSend, Message &response, bool assertOk , string * actualServer ) {
- GodScope gs(_txn);
- if ( lastError._get() )
- lastError.startRequest( toSend, lastError._get() );
- DbResponse dbResponse;
- assembleResponse(_txn, toSend, dbResponse, dummyHost);
- verify( dbResponse.response );
- dbResponse.response->concat(); // can get rid of this if we make response handling smarter
- response = *dbResponse.response;
- return true;
- }
-
- void DBDirectClient::say( Message &toSend, bool isRetry, string * actualServer ) {
- GodScope gs(_txn);
- if ( lastError._get() )
- lastError.startRequest( toSend, lastError._get() );
- DbResponse dbResponse;
- assembleResponse(_txn, toSend, dbResponse, dummyHost);
- }
-
- auto_ptr<DBClientCursor> DBDirectClient::query(const string &ns, Query query, int nToReturn , int nToSkip ,
- const BSONObj *fieldsToReturn , int queryOptions , int batchSize) {
-
- //if ( ! query.obj.isEmpty() || nToReturn != 0 || nToSkip != 0 || fieldsToReturn || queryOptions )
- return DBClientBase::query( ns , query , nToReturn , nToSkip , fieldsToReturn , queryOptions , batchSize );
- //
- //verify( query.obj.isEmpty() );
- //throw UserException( (string)"yay:" + ns );
- }
-
- void DBDirectClient::killCursor( long long id ) {
- // The killCursor command on the DB client is only used by sharding,
- // so no need to have it for MongoD.
- verify(!"killCursor should not be used in MongoD");
- }
-
- const HostAndPort DBDirectClient::dummyHost("0.0.0.0", 0);
-
- unsigned long long DBDirectClient::count(const string &ns, const BSONObj& query, int options, int limit, int skip ) {
- if ( skip < 0 ) {
- warning() << "setting negative skip value: " << skip
- << " to zero in query: " << query << endl;
- skip = 0;
- }
-
- Lock::DBRead lk(_txn->lockState(), ns);
- string errmsg;
- int errCode;
- long long res = runCount( _txn, ns, _countCmd( ns , query , options , limit , skip ) , errmsg, errCode );
- if ( res == -1 ) {
- // namespace doesn't exist
- return 0;
- }
- massert( errCode , str::stream() << "count failed in DBDirectClient: " << errmsg , res >= 0 );
- return (unsigned long long )res;
- }
-
- DBClientBase* createDirectClient(OperationContext* txn) {
- return new DBDirectClient(txn);
- }
-
-
static AtomicUInt32 shutdownInProgress(0);
bool inShutdown() {
diff --git a/src/mongo/db/instance.h b/src/mongo/db/instance.h
index d95f3b710f7..3b0453fddec 100644
--- a/src/mongo/db/instance.h
+++ b/src/mongo/db/instance.h
@@ -73,71 +73,6 @@ namespace mongo {
DbResponse& dbresponse,
const HostAndPort &client );
- /**
- * Embedded calls to the local server using the DBClientBase API without going over the network.
- *
- * Caller does not need to lock, that is handled within.
- *
- * All operations are performed within the scope of a passed-in OperationContext (except when
- * using the deprecated constructor). You must ensure that the OperationContext is valid when
- * calling into any function. If you ever need to change the OperationContext, that can be done
- * without the overhead of creating a new DBDirectClient by calling setOpCtx(), after which all
- * operations will use the new OperationContext.
- */
- class DBDirectClient : public DBClientBase {
- public:
- static const HostAndPort dummyHost;
-
- DBDirectClient(OperationContext* txn);
-
- void setOpCtx(OperationContext* txn) { _txn = txn; };
-
- using DBClientBase::query;
-
- virtual std::auto_ptr<DBClientCursor> query(const std::string &ns, Query query, int nToReturn = 0, int nToSkip = 0,
- const BSONObj *fieldsToReturn = 0, int queryOptions = 0, int batchSize = 0);
-
- virtual bool isFailed() const {
- return false;
- }
-
- virtual bool isStillConnected() {
- return true;
- }
-
- virtual std::string toString() const {
- return "DBDirectClient";
- }
- virtual std::string getServerAddress() const {
- return "localhost"; // TODO: should this have the port?
- }
- virtual bool call( Message &toSend, Message &response, bool assertOk=true , std::string * actualServer = 0 );
- virtual void say( Message &toSend, bool isRetry = false , std::string * actualServer = 0 );
- virtual void sayPiggyBack( Message &toSend ) {
- // don't need to piggy back when connected locally
- return say( toSend );
- }
-
- virtual void killCursor( long long cursorID );
-
- virtual bool callRead( Message& toSend , Message& response ) {
- return call( toSend , response );
- }
-
- virtual unsigned long long count(const std::string &ns, const BSONObj& query = BSONObj(), int options=0, int limit=0, int skip=0 );
-
- virtual ConnectionString::ConnectionType type() const { return ConnectionString::MASTER; }
-
- double getSoTimeout() const { return 0; }
-
- virtual bool lazySupported() const { return true; }
-
- virtual QueryOptions _lookupAvailableOptions();
-
- private:
- OperationContext* _txn;
- };
-
void maybeCreatePidFile();
} // namespace mongo
diff --git a/src/mongo/db/pipeline/pipeline_d.cpp b/src/mongo/db/pipeline/pipeline_d.cpp
index 9f4d4c5b653..1a923abc7b7 100644
--- a/src/mongo/db/pipeline/pipeline_d.cpp
+++ b/src/mongo/db/pipeline/pipeline_d.cpp
@@ -33,7 +33,7 @@
#include "mongo/client/dbclientinterface.h"
#include "mongo/db/catalog/collection.h"
#include "mongo/db/catalog/database.h"
-#include "mongo/db/instance.h"
+#include "mongo/db/dbdirectclient.h"
#include "mongo/db/pipeline/document_source.h"
#include "mongo/db/pipeline/pipeline.h"
#include "mongo/db/query/get_executor.h"
diff --git a/src/mongo/db/repl/master_slave.cpp b/src/mongo/db/repl/master_slave.cpp
index 044ecf88029..939e1e37032 100644
--- a/src/mongo/db/repl/master_slave.cpp
+++ b/src/mongo/db/repl/master_slave.cpp
@@ -50,8 +50,8 @@
#include "mongo/db/catalog/database_catalog_entry.h"
#include "mongo/db/cloner.h"
#include "mongo/db/commands.h"
+#include "mongo/db/dbdirectclient.h"
#include "mongo/db/dbhelpers.h"
-#include "mongo/db/instance.h"
#include "mongo/db/ops/update.h"
#include "mongo/db/query/internal_plans.h"
#include "mongo/db/repl/oplog.h"
diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp
index 5951826e130..d422133db2a 100644
--- a/src/mongo/db/repl/oplog.cpp
+++ b/src/mongo/db/repl/oplog.cpp
@@ -44,11 +44,11 @@
#include "mongo/db/auth/privilege.h"
#include "mongo/db/commands.h"
#include "mongo/db/commands/dbhash.h"
+#include "mongo/db/dbdirectclient.h"
#include "mongo/db/dbhelpers.h"
#include "mongo/db/global_environment_experiment.h"
#include "mongo/db/global_optime.h"
#include "mongo/db/index_builder.h"
-#include "mongo/db/instance.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/ops/update.h"
#include "mongo/db/ops/update_lifecycle_impl.h"
diff --git a/src/mongo/db/repl/rs_config.cpp b/src/mongo/db/repl/rs_config.cpp
index ed7aaef0290..9017d7f715c 100644
--- a/src/mongo/db/repl/rs_config.cpp
+++ b/src/mongo/db/repl/rs_config.cpp
@@ -34,8 +34,8 @@
#include <boost/algorithm/string.hpp>
+#include "mongo/db/dbdirectclient.h"
#include "mongo/db/dbhelpers.h"
-#include "mongo/db/instance.h"
#include "mongo/db/repl/connections.h"
#include "mongo/db/repl/heartbeat.h"
#include "mongo/db/repl/isself.h"
diff --git a/src/mongo/db/restapi.cpp b/src/mongo/db/restapi.cpp
index e419aa0ccf9..931de5fff9e 100644
--- a/src/mongo/db/restapi.cpp
+++ b/src/mongo/db/restapi.cpp
@@ -38,9 +38,9 @@
#include "mongo/db/auth/user_name.h"
#include "mongo/db/background.h"
#include "mongo/db/clientcursor.h"
+#include "mongo/db/dbdirectclient.h"
#include "mongo/db/dbhelpers.h"
#include "mongo/db/dbwebserver.h"
-#include "mongo/db/instance.h"
#include "mongo/db/repl/master_slave.h"
#include "mongo/db/repl/repl_coordinator_global.h"
#include "mongo/util/log.h"
diff --git a/src/mongo/db/ttl.cpp b/src/mongo/db/ttl.cpp
index 903654008d4..1d9989c54dc 100644
--- a/src/mongo/db/ttl.cpp
+++ b/src/mongo/db/ttl.cpp
@@ -42,11 +42,11 @@
#include "mongo/db/commands/fsync.h"
#include "mongo/db/commands/server_status_metric.h"
#include "mongo/db/catalog/database_holder.h"
-#include "mongo/db/instance.h"
+#include "mongo/db/dbdirectclient.h"
+#include "mongo/db/operation_context_impl.h"
#include "mongo/db/ops/delete.h"
#include "mongo/db/repl/repl_coordinator_global.h"
#include "mongo/db/server_parameters.h"
-#include "mongo/db/operation_context_impl.h"
#include "mongo/util/background.h"
#include "mongo/util/log.h"