-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.6.5, 2.8.0-rc1
-
Component/s: Diagnostics
-
None
-
ALL
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
- is duplicated by
-
SERVER-14990 Do not omit the information about the batch if its too big
- Closed
-
SERVER-18173 Being able to control the length of 'query not recording (too large)' message
- Closed
- is related to
-
SERVER-12049 Redact password data from profiler/slowms output for user management commands
- Closed
- related to
-
SERVER-1794 make CurOp query's lifespan same as the op - so we can just keep a pointer
- Closed
-
SERVER-6218 Profile documents should include partial query object instead of "too large" error
- Closed
-
SERVER-13952 Cache partial BSONObj if possible (instead of {$msg: "query not recording (too large)"})
- Closed