summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/repl_settings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repl/repl_settings.cpp')
-rw-r--r--src/mongo/db/repl/repl_settings.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mongo/db/repl/repl_settings.cpp b/src/mongo/db/repl/repl_settings.cpp
index e8cb54d8728..48dad4218cc 100644
--- a/src/mongo/db/repl/repl_settings.cpp
+++ b/src/mongo/db/repl/repl_settings.cpp
@@ -40,6 +40,7 @@
#include "mongo/db/repl/master_slave.h"
#include "mongo/db/repl/oplogreader.h"
#include "mongo/db/repl/rs.h"
+#include "mongo/db/operation_context_impl.h"
#include "mongo/db/storage_options.h"
#include "mongo/db/wire_version.h"
#include "mongo/s/write_ops/batched_command_request.h"
@@ -55,7 +56,7 @@ namespace repl {
return replSettings.slave || replSettings.master || theReplSet;
}
- void appendReplicationInfo(BSONObjBuilder& result, int level) {
+ void appendReplicationInfo(OperationContext* txn, BSONObjBuilder& result, int level) {
if ( replSet ) {
if( theReplSet == 0 || theReplSet->state().shunned() ) {
result.append("ismaster", false);
@@ -88,7 +89,7 @@ namespace repl {
list<BSONObj> src;
{
const char* localSources = "local.sources";
- Client::ReadContext ctx(localSources, storageGlobalParams.dbpath);
+ Client::ReadContext ctx(txn, localSources);
auto_ptr<Runner> runner(InternalPlanner::collectionScan(localSources,
ctx.ctx().db()->getCollection(localSources)));
BSONObj obj;
@@ -151,7 +152,9 @@ namespace repl {
int level = configElement.numberInt();
BSONObjBuilder result;
- appendReplicationInfo(result, level);
+
+ OperationContextImpl txn; // XXX?
+ appendReplicationInfo(&txn, result, level);
return result.obj();
}
} replicationInfoServerStatus;
@@ -196,7 +199,7 @@ namespace repl {
if ( cmdObj["forShell"].trueValue() )
lastError.disableForCommand();
- appendReplicationInfo(result, 0);
+ appendReplicationInfo(txn, result, 0);
result.appendNumber("maxBsonObjectSize", BSONObjMaxUserSize);
result.appendNumber("maxMessageSizeBytes", MaxMessageSizeBytes);