[COMPASS-5366] Commands to list databases and collections fails if primary is not available Created: 15/Dec/21  Updated: 15/Dec/21

Status: Open
Project: Compass
Component/s: None
Affects Version/s: 1.29.5
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Maurizio Casimirri Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Story Points: 2

 Description   

Step to reproduce:

Connect to the sharded cluster configuration of https://github.com/mongodb-js/devtools-docker-test-envs

Compass is taking a lot of time to get past the loading screen. In the logs there are failures like this "Could not find host matching read preference

{ mode: \"primary\" }

for set shard0". The failed attempts seems to take 20 seconds and should be the cause of the delay:

{"t":

{"$date":"2021-12-15T11:11:50.242Z"}

,"s":"D1","c":"COMPASS-DATA-SERVICE","id":1001000030,"ctx":"Connection 14","msg":"Driver command failed","attr":{"address":"127.0.0.1:28004","serverConnectionId":1,"duration":20015,"commandName":"dbStats","failure":"Could not find host matching read preference

{ mode: \"primary\" }

for set shard0"}}

We may want to consider switching those commands to primary-preferred to allow usage of compass in read-only.



 Comments   
Comment by Anna Henningsen [ 15/Dec/21 ]

Just for context, we already always use primaryPreferred for show dbs and show collections in mongosh, and haven’t seen any issues with that approach so far.

Generated at Wed Feb 07 22:39:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.