summaryrefslogtreecommitdiff
path: root/src/mongo/db/curop.cpp
diff options
context:
space:
mode:
authorJason Rassi <rassi@10gen.com>2014-10-14 18:23:47 -0400
committerJason Rassi <rassi@10gen.com>2014-10-15 17:54:15 -0400
commit4b88d369d2489d1c6fac593ffeb1733d7bfc9c7b (patch)
tree8db71bc4e831b1f591478a3b9ef10de63b7ac813 /src/mongo/db/curop.cpp
parent53698194b24a5c889fa9215dae4fa6cd372e9e44 (diff)
downloadmongo-4b88d369d2489d1c6fac593ffeb1733d7bfc9c7b.tar.gz
SERVER-13584 CurOp "ns" reporting should fall back to using OpDebug
Diffstat (limited to 'src/mongo/db/curop.cpp')
-rw-r--r--src/mongo/db/curop.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp
index 55ab25d6570..1ee7ee5c10b 100644
--- a/src/mongo/db/curop.cpp
+++ b/src/mongo/db/curop.cpp
@@ -170,7 +170,9 @@ namespace mongo {
builder->append( "op" , opToString( _op ) );
- builder->append("ns", _ns.toString());
+ // Fill out "ns" from our namespace member (and if it's not available, fall back to the
+ // OpDebug namespace member).
+ builder->append("ns", !_ns.empty() ? _ns.toString() : _debug.ns.toString());
if (_op == dbInsert) {
_query.append(*builder, "insert");
@@ -214,7 +216,11 @@ namespace mongo {
bool a = _active && _start;
bob.append("active", a);
bob.append( "op" , opToString( _op ) );
- bob.append("ns", _ns.toString());
+
+ // Fill out "ns" from our namespace member (and if it's not available, fall back to the
+ // OpDebug namespace member).
+ bob.append("ns", !_ns.empty() ? _ns.toString() : _debug.ns.toString());
+
if (_op == dbInsert) {
_query.append(bob, "insert");
}