[DOCS-10060] Docs for SERVER-27439: Large queries can omit comment in currentOp Created: 29/Mar/17  Updated: 02/Nov/17  Resolved: 02/Nov/17

Status: Closed
Project: Documentation
Component/s: Server
Affects Version/s: None
Fix Version/s: 3.5.5

Type: Task Priority: Major - P3
Reporter: Emily Hall Assignee: Kevin Albertson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on DOCS-8071 Addition of 'originatingCommand' to g... Closed
Documented
documents SERVER-27439 Large queries can omit comment in cur... Closed
Participants:
Days since reply: 6 years, 15 weeks, 5 days ago
Epic Link: DOCS: 3.6 Server

 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.



 Comments   
Comment by Githook User [ 27/Oct/17 ]

Author:

{'email': 'kevin.albertson@10gen.com', 'name': 'Kevin Albertson', 'username': 'kevinAlbs'}

Message: DOCS-10060 add comment to truncated command field

Signed-off-by: kay <kay.kim@10gen.com>
Branch: master
https://github.com/mongodb/docs/commit/2d79e37180f0b818dab54a1531cefc18d4ff43fa

Comment by Kevin Albertson [ 17/Oct/17 ]

From what I can tell there is no length limit of comment.

Note, that the truncate length of currentOp is not 512 bytes but 1000 bytes (blaming curop.cpp shows the latest change to touch this was this commit)

Comment by Asya Kamsky [ 15/Apr/17 ]

What's the length limit for the comment?

And what length of it is preserved?

Generated at Thu Feb 08 07:59:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.