summaryrefslogtreecommitdiff
path: root/db/dbcommands.cpp
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2011-12-15 09:35:47 +0100
committerAntonin Kral <a.kral@bobek.cz>2011-12-15 09:35:47 +0100
commitf0d9a01bccdaeb466c12c92057914bbfef59526c (patch)
tree7679efa1f0daf7d1d906882a15dc77af6b7aef32 /db/dbcommands.cpp
parent5d342a758c6095b4d30aba0750b54f13b8916f51 (diff)
downloadmongodb-f0d9a01bccdaeb466c12c92057914bbfef59526c.tar.gz
Imported Upstream version 2.0.2
Diffstat (limited to 'db/dbcommands.cpp')
-rw-r--r--db/dbcommands.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp
index 31f4b7f..b2e6218 100644
--- a/db/dbcommands.cpp
+++ b/db/dbcommands.cpp
@@ -510,9 +510,11 @@ namespace mongo {
t.appendNumber( "mappedWithJournal" , m );
}
- if( v - m > 5000 ) {
+ int overhead = v - m - connTicketHolder.used();
+
+ if( overhead > 4000 ) {
t.append("note", "virtual minus mapped is large. could indicate a memory leak");
- log() << "warning: virtual size (" << v << "MB) - mapped size (" << m << "MB) is large. could indicate a memory leak" << endl;
+ log() << "warning: virtual size (" << v << "MB) - mapped size (" << m << "MB) is large (" << overhead << "MB). could indicate a memory leak" << endl;
}
t.done();
@@ -949,7 +951,7 @@ namespace mongo {
}
list<BSONObj> all;
- auto_ptr<DBClientCursor> i = db.getIndexes( toDeleteNs );
+ auto_ptr<DBClientCursor> i = db.query( dbname + ".system.indexes" , BSON( "ns" << toDeleteNs ) , 0 , 0 , 0 , QueryOption_SlaveOk );
BSONObjBuilder b;
while ( i->more() ) {
BSONObj o = i->next().removeField("v").getOwned();
@@ -1104,6 +1106,10 @@ namespace mongo {
BSONObj sort = BSON( "files_id" << 1 << "n" << 1 );
shared_ptr<Cursor> cursor = bestGuessCursor(ns.c_str(), query, sort);
+ if ( ! cursor ) {
+ errmsg = "need an index on { files_id : 1 , n : 1 }";
+ return false;
+ }
auto_ptr<ClientCursor> cc (new ClientCursor(QueryOption_NoCursorTimeout, cursor, ns.c_str()));
int n = 0;