Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-16324

Command execution log line displays "query not recording (too large)" instead of abbreviated command object

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.6.6, 2.8.0-rc2
    • 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
      

            Assignee:
            rassi J Rassi
            Reporter:
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: