summaryrefslogtreecommitdiff
path: root/src/mongo/db/curop.cpp
diff options
context:
space:
mode:
authorAdam Midvidy <amidvidy@gmail.com>2015-06-25 19:42:39 -0400
committerAdam Midvidy <amidvidy@gmail.com>2015-06-26 15:01:08 -0400
commit780745072104ee4d0514f09e71765ac99d380bdc (patch)
treeae72be625de44027f6426a20c92ec043da530936 /src/mongo/db/curop.cpp
parenta66cc2118c711caf28a823be7c79cbf1b5c0942c (diff)
downloadmongo-780745072104ee4d0514f09e71765ac99d380bdc.tar.gz
SERVER-19143 remove ns from OpDebug and synchronize access to NS in curOp
Diffstat (limited to 'src/mongo/db/curop.cpp')
-rw-r--r--src/mongo/db/curop.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp
index 335d2107fa9..818a516ba9e 100644
--- a/src/mongo/db/curop.cpp
+++ b/src/mongo/db/curop.cpp
@@ -233,11 +233,7 @@ void CurOp::reportState(BSONObjBuilder* builder) {
builder->append("op", opToString(_op));
- // Fill out "ns" from our namespace member (and if it's not available, fall back to the
- // OpDebug namespace member). We prefer our ns when set because it changes to match each
- // accessed namespace, while _debug.ns is set once at the start of the operation. However,
- // sometimes _ns is not yet set.
- builder->append("ns", !_ns.empty() ? _ns : _debug.ns);
+ builder->append("ns", _ns);
if (_op == dbInsert) {
_query.append(*builder, "insert");
@@ -375,7 +371,6 @@ uint64_t CurOp::MaxTimeTracker::getRemainingMicros() const {
void OpDebug::reset() {
op = 0;
iscommand = false;
- ns = "";
query = BSONObj();
updateobj = BSONObj();
@@ -432,7 +427,8 @@ string OpDebug::report(const CurOp& curop, const SingleThreadedLockStats& lockSt
s << "command ";
else
s << opToString(op) << ' ';
- s << ns;
+
+ s << curop.getNS();
if (!query.isEmpty()) {
if (iscommand) {
@@ -556,7 +552,7 @@ void OpDebug::append(const CurOp& curop,
const size_t maxElementSize = 50 * 1024;
b.append("op", iscommand ? "command" : opToString(op));
- b.append("ns", ns);
+ b.append("ns", curop.getNS());
if (!query.isEmpty()) {
appendAsObjOrString(iscommand ? "command" : "query", query, maxElementSize, &b);