[SERVER-44892] getShardDistribution should use $collStats agg stage instead of collStats command Created: 02/Dec/19  Updated: 29/Oct/23  Resolved: 17/Mar/20

Status: Closed
Project: Core Server
Component/s: Sharding, Shell
Affects Version/s: None
Fix Version/s: 4.2.6, 4.4.0-rc0, 4.0.18, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Alex Bevilacqua Assignee: Tommaso Tocci
Resolution: Fixed Votes: 0
Labels: neweng, sharding-4.4-stabilization, sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File screenshot-1.png    
Issue Links:
Backports
Problem/Incident
is caused by SERVER-44891 collStats will fail if resulting BSON... Closed
Related
is related to SERVER-44051 getShardDistribution() does not repor... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4, v4.2, v4.0
Sprint: Sharding 2020-03-23
Participants:
Case:

 Description   

See https://gist.github.com/alexbevi/dc51c0ce4820f46e46feca06dbdc64bb for repro details.

As getShardDistribution relies on the results of the collStats command, if the underlying command fails getShardDistribution can incorrectly report that the "Collection is not sharded". This command should use the $collStats agg stage to prevent the problem described in SERVER-44891.



 Comments   
Comment by Githook User [ 30/Mar/20 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-44892 getShardDistribution should use $collStats agg stage instead of collStats command

(cherry picked from commit eae89bb9aa53a7b3a7164d971be8e8be991d33a2)
Branch: v4.0
https://github.com/mongodb/mongo/commit/3548d42acd178b5bfb26d4688062dc7e01d82d70

Comment by Githook User [ 30/Mar/20 ]

Author:

{'name': 'Tommaso Tocci', 'username': 'toto-dev', 'email': 'tommaso.tocci@mongodb.com'}

Message: SERVER-44892 getShardDistribution should use $collStats agg stage instead of collStats command

(cherry picked from commit 67a6dee604b91e759d30d97d72b0cb9ddbdd06f8)
Branch: v4.2
https://github.com/mongodb/mongo/commit/0a151a58d8977f6341f53883f2ce5bdcbd545431

Comment by Githook User [ 25/Mar/20 ]

Author:

{'name': 'Tommaso Tocci', 'username': 'toto-dev', 'email': 'tommaso.tocci@mongodb.com'}

Message: SERVER-44892 getShardDistribution should use $collStats agg stage instead of collStats command

(cherry picked from commit 2563d9862806d35e4d9964bbefd5b79fd5a79c91)
Branch: v4.4
https://github.com/mongodb/mongo/commit/67a6dee604b91e759d30d97d72b0cb9ddbdd06f8

Comment by Githook User [ 17/Mar/20 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-44892 getShardDistribution should use $collStats agg stage instead of collStats command
Branch: master
https://github.com/mongodb/mongo/commit/2563d9862806d35e4d9964bbefd5b79fd5a79c91

Comment by Charlie Swanson [ 20/Dec/19 ]

I'm re-opening this request because the query team isn't planning on changing anything about the collStats command, and I think the fix is for getShardDistribution to use the $collStats agg stage instead. I will re-title the ticket as such.

Comment by Carl Champain (Inactive) [ 02/Dec/19 ]

Hi alex.bevilacqua,

This appears to be a duplicate of SERVER-44051. It is still open and is about collStats exceeding the maxBSONSize of 16MB due to a lot of shard metadata.
I'm going to close this ticket now.

Generated at Thu Feb 08 05:07:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.