[SERVER-53859] Add queryHash to the mongos slow query logs Created: 18/Jan/21 Updated: 29/Oct/23 Resolved: 07/Jul/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Logging |
| Affects Version/s: | 4.4.1 |
| Fix Version/s: | 5.1.0-rc0 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Ankit Shah | Assignee: | Mickey Winters |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||
| Sprint: | Query Execution 2021-05-31, Query Execution 2021-06-14, Query Execution 2021-06-28, Query Execution 2021-07-12 | ||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||||||||||
| Description |
|
`queryHash` field introduced in slow query logs in v4.2 is available only in `mongod` logs and not in `mongos` logs. The documentation does not have any mention of relevant behaviour. Is this expected or requires any configuration change? Sample mongos slow query log:
|
| Comments |
| Comment by Githook User [ 07/Jul/21 ] |
|
Author: {'name': 'Mickey. J Winters', 'email': 'mickey.winters@mongodb.com', 'username': 'mjrb'}Message: |
| Comment by Ankit Shah [ 23/Jun/21 ] |
|
@Mickey Winters That will be fine for my use case. With this implementation, for a given query shape I will have (no. of shards + no. of mongos) queryHashes, which should be manageable. Thanks. |
| Comment by Mickey Winters [ 10/Jun/21 ] |
|
Hey ankit.shah.sm@gmail.com I've been working on this ticket recently. One thing I wanted to point out is that the queryHash is not guaranteed to be the same if you are cross referencing between mongod and mongos. However, It can still be useful for grouping slow queries by shape in the mongos log. Does this help you with your use case? |
| Comment by David Storch [ 03/Feb/21 ] |
|
Hi ankit.shah.sm@gmail.com! This behavior is by design, but it is definitely something that would be nice to add in the future. I am going to convert this ticket to type "Improvement" rather than "Bug" and retitle it accordingly. I am going to add this ticket back to our triage queue so we can decide on its priority. The reason that the "queryHash" field does not appear on mongos is that its implementation is currently tied to the plan cache, and plan caching currently takes place on mongod. However, unlike the "planCacheKey", the "queryHash" is not inherently tied to the plan cache and we could definitely introduce it in the mongos logs as well. |
| Comment by Ratika Gandhi [ 29/Jan/21 ] |
|
cc. craig.homa |
| Comment by Edwin Zhou [ 25/Jan/21 ] |
|
Thanks for your ticket! I can understand why you'd like to see the queryHash in a mongos slow log. I'll pass this along to the appropriate team. Best, |