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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.6
    • Component/s: Shell API
    • Labels:
      None
    • Documentation Changes:
      Not Needed
    • Sprint:
      Iteration Kampala

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: