Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-46

Changing process name prevents mongostat discover to find shard members

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: Legacy C++ Implementation
    • Fix Version/s: 3.0.0-rc9
    • Component/s: mongostat
    • Labels:
    • Case:
    • Epic Link:
    • Documentation Changes:
      Not Needed

      Description

      If a user launches a mongos process with a different binary name, then mongostat --discover will not find any of the nodes in the sharded cluster. Only the mongos itself will be found.

      The issue stems from:
      https://github.com/mongodb/mongo/blob/master/src/mongo/db/server_options_helpers.cpp#L903

      // FIXME: This function will not return the correct value if someone renames the mongos binary
      bool isMongos() { return serverGlobalParams.binaryName == "mongos"; }

      and
      https://github.com/mongodb/mongo/blob/master/src/mongo/tools/stat_util.cpp#L63

              bool isMongos =  b["shardCursorType"].type() == Object || b["process"].String() == "mongos";

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              andre.defrere Andre de Frere
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: