Commands to list databases and collections fails if primary is not available

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: 1.29.5
    • Component/s: None
    • None
    • 2
    • None
    • None

      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.

            Assignee:
            Unassigned
            Reporter:
            Maurizio Casimirri
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: