[SERVER-42282] Consider replacing CommandOnShardedViewNotSupportedOnMongod mechanism with rewrite / routing from shard Created: 18/Jul/19 Updated: 20/Mar/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | James Wahlin | Assignee: | Backlog - Query Optimization |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | read-only-views | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Assigned Teams: |
Query Optimization
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
When a read against a non-materialized view is performed in a sharded cluster, the read is first sent to the primary shard for the database, which then looks up the view definition and returns to mongos as part of a CommandOnShardedViewNotSupportedOnMongod error response. We could consider instead performing the rewrite locally on the primary shard and then performing shard to shard routing. This would save us a network hop from the primary shard back to mongos. |
| Comments |
| Comment by Ana Meza [ 08/Oct/21 ] |
|
Paasing this over to QO since this seems more of a Distributed Planning issues and it a bit big piece for Quick win |
| Comment by James Wahlin [ 30/Jun/20 ] |
|
With the resolution of |
| Comment by Charlie Swanson [ 27/Feb/20 ] |
|
Flagging for re-triage. The new mechanisms we built to support $unionWith running on a shard may allow us to do this relatively easily. I'd recommend considering this as a quick win. |