diff --git a/db/instance.cpp b/db/instance.cpp index 85133be84c4..e6d37089948 100644 --- a/db/instance.cpp +++ b/db/instance.cpp @@ -230,7 +230,7 @@ namespace mongo { OPWRITE; try { ss << "remove "; - receivedDelete(m); + receivedDelete(m, ss); } catch ( AssertionException& e ) { LOGSOME problem() << " Caught Assertion receivedDelete, continuing" << endl; @@ -327,13 +327,14 @@ namespace mongo { bool upsert = flags & 1; { string s = query.toString(); + ss << " query: " << s; strncpy(currentOp.query, s.c_str(), sizeof(currentOp.query)-1); } bool updatedExisting = updateObjects(ns, toupdate, query, flags & 1, ss); recordUpdate( updatedExisting, ( upsert || updatedExisting ) ? 1 : 0 ); } - void receivedDelete(Message& m) { + void receivedDelete(Message& m, stringstream &ss) { DbMessage d(m); const char *ns = d.getns(); assert(*ns); @@ -345,6 +346,7 @@ namespace mongo { BSONObj pattern = d.nextJsObj(); { string s = pattern.toString(); + ss << " query: " << s; strncpy(currentOp.query, s.c_str(), sizeof(currentOp.query)-1); } int n = deleteObjects(ns, pattern, justOne, true); @@ -536,7 +538,7 @@ namespace mongo { } else if ( m.data->operation() == dbDelete ) { ss << "remove "; - receivedDelete(m); + receivedDelete(m, ss); } else if ( m.data->operation() == dbGetMore ) { DEV log = true; diff --git a/db/instance.h b/db/instance.h index e810c8c3cdb..f4c9745e0ce 100644 --- a/db/instance.h +++ b/db/instance.h @@ -91,7 +91,7 @@ namespace mongo { void receivedKillCursors(Message& m); void receivedUpdate(Message& m, stringstream& ss); - void receivedDelete(Message& m); + void receivedDelete(Message& m, stringstream& ss); void receivedInsert(Message& m, stringstream& ss); void receivedGetMore(DbResponse& dbresponse, /*AbstractMessagingPort& dbMsgPort, */Message& m, stringstream& ss); void receivedQuery(DbResponse& dbresponse, /*AbstractMessagingPort& dbMsgPort, */Message& m, stringstream& ss, bool logit);