[SERVER-82471] Make sure explain.find issued on mongos sends a modified query to the shards Created: 26/Oct/23 Updated: 17/Nov/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Denis Grebennicov | Assignee: | Backlog - Query Execution |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | quick-win, tech-debt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Assigned Teams: |
Query Execution
|
||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
While mongos sends modified find query to shards (as part of ClusterFind::runQuery()), it does so only when the command has to be executed and not explained. This causes confusion for users as well as developers and make you not trust in explain output, as it is not the same plan. As well as this makes testing harder, as explained plan is not the same as the plan found in the $planCacheStats It's worth mentioning that since queries in run and explain are different, so are their queryHashes, therefore once can not run explain, retrieve the queryHash and look for the queries in $planCacheStats or slow query logs, as they are different.
This issue goes back in time, to at least 3.4.4, so it's a very old bug. |