Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-982

sh.status() and similar methods have extra mongos check

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.0.6
    • Affects Version/s: None
    • Component/s: Shell API
    • None
    • Not Needed
    • Iteration Kampala

      In the getConfigDB helper that is used by sh.status() and a number of similar sharding-related methods, we verify that the hello response indicates that we are actually connected to a mongos instance.

      However, as long as the required databases (config etc.) are present, these methods can work even when not connected to a mongos.

      One example use case is running sh.status() on standalone instances that contain data restored from a sharded instance, which seems to be a common TSE operation.

      Related Slack thread: https://mongodb.slack.com/archives/CUHC9R8J0/p1631144479043300

      We should print a warning instead of outright throwing.

      Additionally, our sh.status() method does not take a configDB argument, unlike the legacy shell variant. We should fix that as well.

            Assignee:
            anna.henningsen@mongodb.com Anna Henningsen
            Reporter:
            anna.henningsen@mongodb.com Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: