summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/client.cpp4
-rw-r--r--db/curop.h6
-rw-r--r--db/instance.cpp10
-rw-r--r--jstests/index11.js4
-rw-r--r--mongo.xcodeproj/project.pbxproj2
-rw-r--r--tools/files.cpp2
-rw-r--r--tools/import.cpp2
-rw-r--r--tools/restore.cpp1
8 files changed, 27 insertions, 4 deletions
diff --git a/db/client.cpp b/db/client.cpp
index 5d8793230bb..fb5f91a151a 100644
--- a/db/client.cpp
+++ b/db/client.cpp
@@ -209,6 +209,10 @@ namespace mongo {
stringstream clientStr;
clientStr << inet_ntoa( _remote.sin_addr ) << ":" << ntohs( _remote.sin_port );
b.append("client", clientStr.str());
+
+ if ( _client )
+ b.append( "desc" , _client->desc() );
+
return b.obj();
}
diff --git a/db/curop.h b/db/curop.h
index 8012e817a23..fd0097690ae 100644
--- a/db/curop.h
+++ b/db/curop.h
@@ -148,11 +148,15 @@ namespace mongo {
}
AtomicUInt opNum() const { return _opNum; }
+
+ /** if this op is running */
bool active() const { return _active; }
+
int getLockType() const { return _lockType; }
bool isWaitingForLock() const { return _waitingForLock; }
int getOp() const { return _op; }
-
+
+
/** micros */
unsigned long long startTime() {
ensureStarted();
diff --git a/db/instance.cpp b/db/instance.cpp
index 0f399327b87..9408bbe11d9 100644
--- a/db/instance.cpp
+++ b/db/instance.cpp
@@ -89,13 +89,19 @@ namespace mongo {
b.append("err", "unauthorized");
}
else {
+ DbMessage d(m);
+ QueryMessage q(d);
+ bool all = q.query["$all"].trueValue();
vector<BSONObj> vals;
{
+ Client& me = cc();
boostlock bl(Client::clientsMutex);
for( set<Client*>::iterator i = Client::clients.begin(); i != Client::clients.end(); i++ ) {
Client *c = *i;
+ if ( c == &me )
+ continue;
CurOp& co = *(c->curop());
- if( co.active() )
+ if( all || co.active() )
vals.push_back( co.infoNoauth() );
}
}
@@ -106,7 +112,7 @@ namespace mongo {
b.append("info", "use command {unlock:0} to terminate the fsync write/snapshot lock");
}
}
-
+
replyToQuery(0, m, dbresponse, b.obj());
}
diff --git a/jstests/index11.js b/jstests/index11.js
index bc4e757cf1c..2c91b130dc9 100644
--- a/jstests/index11.js
+++ b/jstests/index11.js
@@ -10,7 +10,7 @@ resetParallel = function() {
doParallel = function( work ) {
resetParallel();
- startMongoProgramNoConnect( "mongo", "--eval", work + "; db." + baseName + "_parallelStatus.save( {done:1} );" );
+ startMongoProgramNoConnect( "mongo", "--eval", work + "; db." + baseName + "_parallelStatus.save( {done:1} );", db.getMongo().host );
}
doneParallel = function() {
@@ -21,6 +21,8 @@ waitParallel = function() {
assert.soon( function() { return doneParallel(); }, "parallel did not finish in time", 300000, 1000 );
}
+print( "host" );
+print( db.getMongo().host );
size = 500000;
while( 1 ) { // if indexing finishes before we can run checks, try indexing w/ more data
print( "size: " + size );
diff --git a/mongo.xcodeproj/project.pbxproj b/mongo.xcodeproj/project.pbxproj
index 3702c4f8af6..c32ce7e4c78 100644
--- a/mongo.xcodeproj/project.pbxproj
+++ b/mongo.xcodeproj/project.pbxproj
@@ -34,6 +34,7 @@
931979810FBC67FB001FE537 /* utils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = utils.cpp; sourceTree = "<group>"; };
931A027A0F58AA4400147C0E /* jsobjmanipulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsobjmanipulator.h; sourceTree = "<group>"; };
9323308F1121E5B100712706 /* index11.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = index11.js; sourceTree = "<group>"; };
+ 93233125112212D600712706 /* index12.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = index12.js; sourceTree = "<group>"; };
93278F570F72D32900844664 /* gridfs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gridfs.cpp; sourceTree = "<group>"; };
93278F580F72D32900844664 /* gridfs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gridfs.h; sourceTree = "<group>"; };
93278F610F72D39400844664 /* cursors.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cursors.cpp; sourceTree = "<group>"; };
@@ -736,6 +737,7 @@
934BEB9A10DFFA9600178102 /* jstests */ = {
isa = PBXGroup;
children = (
+ 93233125112212D600712706 /* index12.js */,
9323308F1121E5B100712706 /* index11.js */,
93D5A8921117A1380052C931 /* regex6.js */,
938E639A110FC66900A8760A /* auth */,
diff --git a/tools/files.cpp b/tools/files.cpp
index e69a0701583..2cbda12e9f4 100644
--- a/tools/files.cpp
+++ b/tools/files.cpp
@@ -139,12 +139,14 @@ public:
}
+ conn().getLastError();
cout << "done!";
return 0;
}
if ( cmd == "delete" ){
g.removeFile(filename);
+ conn().getLastError();
cout << "done!";
return 0;
}
diff --git a/tools/import.cpp b/tools/import.cpp
index f3eb42e0230..17f328ea228 100644
--- a/tools/import.cpp
+++ b/tools/import.cpp
@@ -238,6 +238,8 @@ public:
}
cout << "imported " << num << " objects" << endl;
+
+ conn().getLastErr();
if ( errors == 0 )
return 0;
diff --git a/tools/restore.cpp b/tools/restore.cpp
index 19e3a26a9d3..310e48692cf 100644
--- a/tools/restore.cpp
+++ b/tools/restore.cpp
@@ -56,6 +56,7 @@ public:
* .bson file, or a single .bson file itself (a collection).
*/
drillDown(root, _db != "", _coll != "");
+ conn().getLastError();
return EXIT_CLEAN;
}