Details
-
Task
-
Resolution: Done
-
Major - P3
-
None
-
None
Description
Documentation Request Summary:
Currently, our diagnostic output serializes objects which exceed a given size limit - 512 bytes in the case of currentOp, 50KB for the profiler - to an abbreviated string representation, similar to the "query" field in the following entry (shortened for clarity):
{ "op" : "query", "ns" : "profile_find.test", "query" : "{ find: \"test\", filter:
{ 0: \"aaaaaaaaaaaaaaaaaaaaa..." }This commit alters the format by moving the string summary to a field called "$truncated" within an enclosing object:
{ "op" : "query", "ns" : "profile_find.test", "query" : { "$truncated" : "{ find: \"test\", filter:
{ 0: \"aaaaaaaaaaaaaaaaaaaaa...", "comment" : "profile_find_comment" }}
If the operation supports a comment parameter and one is present, as in the example above, it will be retained as a separate field in the enclosing object to better facilitate tracing these operations in diagnostic output.
This change affects both currentOp and the profiler; in the latter case, it applies to the "query", "command", "originatingCommand" and "updateObj" fields. The string serialization itself remains unchanged from its previous behaviour.
Please feel free to contact me if any of the above isn't sufficiently clear, or if further details are needed.
Engineering Ticket Description:
Since the main purpose of a user-specified comment is to allow a query/aggregation to be easily identified and traced through its execution, the comment should always be visible in currentOp, profiler and logs. SERVER-23260 addressed this issue for 3.4 profiler and logs, but in cases where a query is too large for currentOp it is converted to a string and truncated, which can again elide the comment.
Attachments
Issue Links
- depends on
-
DOCS-8071 Addition of 'originatingCommand' to getMore log messages & profiler entries
-
- Closed
-
- documents
-
SERVER-27439 Large queries can omit comment in currentOp
-
- Closed
-