[SERVER-66270] ExpressionContext::inMongos does not reliably reflect the execution context Created: 05/May/22 Updated: 06/Mar/23 |
|
| Status: | Open |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Bernard Gorman | Assignee: | Backlog - Query Execution |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | auto-reverted | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Assigned Teams: |
Query Execution
|
||||||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||||||
| Backport Requested: |
v6.1, v6.0
|
||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||
| Linked BF Score: | 173 | ||||||||||||||||||||||||||||||||
| Description |
|
When creating an ExpressionContext within ClusterAggregate::runAggregate, we unconditionally set the inMongos field to true. We do this because, at the time this code was written, ClusterAggregate was only linked into and available on mongoS. However, this appears to have changed as a result of Since ClusterAggregate no longer exclusively runs on mongoS, we need a more robust means of setting inMongos. We should also investigate whether ExpressionContext::fromMongos reliably reflects the execution context. |
| Comments |
| Comment by Bernard Gorman [ 09/May/22 ] |
|
For context: we found that fixing the inMongos parameter such that it accurately reflected whether or not we were executing on mongoS caused the PeriodicShardedIndexConsistencyChecker to fail. This is because the value of fromMongos in the aggregate command sent to the shards depends on inMongos, and if fromMongos is false then the shards do not include the shard field in the output of the $indexStats stage at the start of the PeriodicShardedIndexConsistencyChecker pipeline, which causes the pipeline's subsequent grouping logic to fail. We may want to revisit our reliance on fromMongos when deciding whether to output the shard field in the $indexStats stage (and others, such as $currentOp, where the same approach is used). |
| Comment by xgen-buildbaron-user [ 07/May/22 ] |
|
Ticket re-opened due to revert. noPassthrough began a consistent failure of jstests\noPassthrough\sharded_index_consistency_metrics.js,jstests\noPassthrough\sharded_index_consistency_metrics_stale_version_retries.js |
| Comment by Githook User [ 07/May/22 ] |
|
Author: {'name': 'auto-revert-processor', 'email': 'dev-prod-dag@mongodb.com'}Message: Revert "SERVER-66270 Set ExpressionContext::inMongos to true only on mongos" This reverts commit 4170c36e4d2551a0f5e7044c63ee9b8a2a5b48b5. |
| Comment by Githook User [ 07/May/22 ] |
|
Author: {'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com', 'username': 'banarun'}Message: SERVER-66270 Set ExpressionContext::inMongos to true only on mongos |