Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-36665

Free Monitoring registration and metrics pings are incomplete for uninitialized repl set members

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Server Security
    • ALL
    • Hide

      1. Start an instance: mongod --replSet=stuff [...]
      2. Shell into the instance: mongo
      3. Enable Free Monitoring: db.enableFreeMonitoring()

      Show
      1. Start an instance: mongod --replSet=stuff [...] 2. Shell into the instance: mongo 3. Enable Free Monitoring: db.enableFreeMonitoring()

      When a mongod is started with --replSet=blah but rs.initialize() hasn't been called yet, both the register request and the metrics request have missing/broken values, though in different ways:

      On register request, the IsMaster struct is missing all host/hostname values, eg.:

      "IsMaster":
      {
      "LocalTime":"2018-08-02T20:52:50.864-04:00",
      "IsMaster":false,
      "Msg":"",
      "SetName":"", // <-- missing
      "Hosts":null, // <-- missing
      "IsSecondary":false,
      "PrimaryHostPort":"", // <-- missing
      "HostPort":"", // <-- missing
      "ArbiterOnly":false
      }
      

      (The missing values are pretty reasonable for an uninitialized repl set member - except I'd expect HostPort to have something.)

      On metrics pings, a number of the discovery structs are nil altogether, eg.:

      IsMaster:0xc420408020 
      BuildInfo:<nil> 
      HostInfo:<nil> 
      StorageEngine:<nil> ReplSetGetConfig:<nil> RsStatus:0xc420408378 OplogUUID: 
      ClusterManager:{Id:[] NextVersion:0 LastVersion:0} ServerStatus:0xc4204080c0
      

      This "weird" state persists until rs.initialize() is called (you can even restart it and still see these weird payloads), at which point everything seems to snap into place and all is well.

      Note: we've worked around both of these issues in CLOUDP-31606 and CLOUDP-31813, so this isn't a massively high priority from our perspective, but it might indicate issues worth addressing from your perspective?

            Assignee:
            backlog-server-security [DO NOT USE] Backlog - Security Team
            Reporter:
            duncan.armstrong@mongodb.com Duncan Armstrong
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: