-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Sharding
-
Sharding
As part of the SERVER-4554 fix, ChunkManager::getShardsForQuery() returns a dummy shard for an unsatisfiable query (one that cannot match any documents). The reason for this is that some callers of getShardsForQuery() expect that at least one shard will be returned for any query.
I believe the current behavior is functionally correct, but we are querying the dummy shard unnecessarily for these unsatisfiable queries.
The current implementations of count and find have explicit assertions that the returned list of shards is not empty. It would make sense to ensure/check that all callers for getShardsForQuery() can handle an empty set of shards. Some of the tricky cases I can see are:
- making sure the parallel cursor works correctly with zero shards (and zero connections)
- making sure there are no issues relating to shard version information -> Greg suggested that he should look at this.
I will add some additional comments indicating which pieces of code will need to be touched to change the behavior of getShardsForQuery().
- is related to
-
SERVER-4554 shard selection code asserts for certain unsatisfiable queries
- Closed