-
Type:
Bug
-
Status: Closed
-
Priority:
Major - P3
-
Resolution: Fixed
-
Affects Version/s: 2.6.8
-
Fix Version/s: 2.6.9
-
Component/s: Aggregation Framework, Querying
-
Labels:None
-
Backwards Compatibility:Fully Compatible
-
Operating System:ALL
-
Steps To Reproduce:
In sharded cluster aggregation by _id alone results in duplicate records in case of orphan records exists on the other shards.
If the record with _id = 1 exists on the shard A (active) and shard B (orphan), the following aggregate will return 2 records.
db.test.aggregate([{$match: {_id: 1} }])
|
It just happens that this is the suggested way of getting an accurate (along with $group stage) count in sharded cluster in the documentation.
The incorrect behaviour is not noticed in 2.4.x and 3.0.0-rc11.