-
Type: Bug
-
Resolution: Gone away
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
-
ALL
-
QO 2023-12-11, QO 2023-12-25, QO 2024-01-08, QO 2024-01-22
-
135
An aggregation pipeline like
[{$documents: [{x: 1, z: 'a\0'}, {clean: 2147483647, 'netstat': 'off'}, {x: 3, z: [1, 2, 3]}]}, {$lookup: {from: 'test_coll', as: 'fullDocument', localField: 'x', foreignField: 'x'}}];
should run on mongos if 'some_db.test_coll' does not exist, or on a shard otherwise. Currently, it will throw if someone drops the database at the wrong moment during the query execution.
The reason for this is the deferred construction of CollectionRoutingInfo in ClusterAggregation::runAggregate().
One possible solution would be to acquire CollectionRoutingInfo only once during query optimization and rewrite the pipeline accordingly. For instance, if we know 'some_db.test_coll' does not exist, we can remove the '$lookup' stage.
When this is done, we should consider replacing the uassert with a tassert in runPipelineOnMongoS(), so that the fuzzer tests can discover unexpected issues.
- is related to
-
SERVER-83461 Pipeline::canRunOnMongos triggers invariant failure because targeting answer differs from AggregationTargeter::make()
- Closed
-
SERVER-83611 Do not obtain CRI multiple times in cluster aggregate path
- Closed
-
SERVER-79583 Get rid of HostTypeRequirement::kPrimaryShard once and for all
- Closed
-
SERVER-79718 Remove HostTypeRequirement::kPrimaryShard from $out
- Closed
- related to
-
SERVER-83658 Refactor acquisition of CollectionRoutingInfo across sharded aggregation path
- Backlog