Info
When a command with a large command object is run and the operation is logged, the message "query not recording (too large)" is recorded in the log line instead of the abbreviated command object.
To reproduce, run the following snippet with the mongo shell:
var str = ''; for (i=0; i<512; ++i) { str += 'a'; }; db.foo.count({a: str});
When run against a 2.6.5 mongod with the verbose flag set, this command generates the following entry in the mongod log:
2014-11-25T16:23:52.809-0500 [conn1] command test.$cmd command: count { $msg: "query not recording (too large)" } keyUpdates:0 numYields:0 locks(micros) W:895 r:60 reslen:58 0ms
This is a regression introduced in 2.5.5 by https://github.com/mongodb/mongo/commit/bc25799bbeaee8e6133804ffa6fece31e8a62236#diff-96c987e2693d90345a318d2681e2c45eR604>. The issue is that the command object is read out of CurOp::_query (which is limited in size) instead of OpDebug::query.
When run against 2.4.12, an abbreviated version of the query is logged instead, as expected:
Tue Nov 25 16:23:19.739 [conn1] command test.$cmd command: { count: "foo", query: { a: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..." }, fields: {} } ntoreturn:1 keyUpdates:0 locks(micros) W:232 r:29 reslen:58 0ms
Top User Comments
xgen-internal-githook commented on Tue, 25 Nov 2014 22:46:03 +0000:
Author:
{u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}
Message: SERVER-16324 OpDebug::report() should read query from OpDebug, not CurOp
(cherry picked from commit 8f0d423946be1873d0af5c6db488d2bee9629899)
Branch: v2.6
https://github.com/mongodb/mongo/commit/dfe24c01783660cd923ca2a07e61dbb16ac8c736
xgen-internal-githook commented on Tue, 25 Nov 2014 22:45:28 +0000:
Author:
{u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}
Message: SERVER-16324 OpDebug::report() should read query from OpDebug, not CurOp
Branch: master
https://github.com/mongodb/mongo/commit/8f0d423946be1873d0af5c6db488d2bee9629899