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

Profile documents should include partial query object instead of "too large" error

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.8.0-rc2
    • Affects Version/s: 2.0.5
    • Component/s: Diagnostics
    • Labels:
      None
    • Environment:
      Linux 64 Bit
    • Server 2.7.3, Server 2.7.4, Query 2.7.8

      When a profile line becomes too large, essential fields as for example "millis" are omitted:

      PRIMARY> db.system.profile.findOne({err:{$exists:true},abbreviated:{$exists:false}})
      {
          "ts" : ISODate("2012-06-26T04:37:06.372Z"),
          "client" : "x.x.x.x",
          "user" : "",
          "err" : "profile line too large (max is 100KB)"
      }
      

      However, in some cases there is a field "abbreviated" in which we can find the missing "millis" field:

      PRIMARY> db.system.profile.findOne({err:{$exists:true},abbreviated:{$exists:true}})
      {
          "ts" : ISODate("2012-06-24T19:02:46.054Z"),
          "client" : "x.x.x.x",
          "user" : "",
          "err" : "profile line too large (max is 100KB)",
          "abbreviated" : "{ ts: new Date(1340564566053), op: \"getmore\", ns: \"offerStore.offer\", query: { _id: { $in: [ 258406435, ...cut out... ] } }, cursorid: 532897853037598938, nreturned: 2708, responseLength: 4195498, millis: 5620, client: \"x.x.x.x\", user: \"\" }"
      }
      

      As the field "abbreviated" is a String, not an Object, we can't even use dot notation to reach into the object to retrieve millis. Thus, we need to use eval or a regexp to do so.

      Essential information like millis, cursorid, nreturned, responseLength, client and user should ALWAYS be present in a profiling document. When the profile line is too large, then it's certainly not to large because of these fields. It's too large because of the query! So cut out or shorten the query but not the other fields!

      Last but not least: What are the rules to have an "abbreviated" field or not? Btw. what has been abbreviated - it seems to be complete though?

            Assignee:
            rassi J Rassi
            Reporter:
            kay.agahd@idealo.de Kay Agahd
            Votes:
            4 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: