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

move logging for removing a ReplicaSetMonitor to ReplicaSetMonitorManager::removeMonitor()

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.4.0-rc2
    • Affects Version/s: 3.4.0-rc1
    • Component/s: Sharding
    • None
    • Fully Compatible
    • Sharding 2016-10-31

      I noticed the log line is sometimes printed with the setName for the set being removed as blank:

      https://logkeeper.mongodb.org/build/fe4fa63ca9b92ae1c06cce3da7f0f901/test/57feb247be07c4185402a0b9#L698

      s20013| 2016-10-12T21:59:55.512+0000 I SHARDING [conn1] ShardRegistry::reload: Removing RSM for
      

      This is because the line is printed in ShardRegistry::reload() when a shard that existed previously in the ShardRegistry cache no longer appears in the reload, regardless of whether the shard is a standalone or replica set:

      https://github.com/mongodb/mongo/blob/r3.4.0-rc1/src/mongo/s/client/shard_registry.cpp#L305

      It's somewhat misleading since, in the standalone case, no ReplicaSetMonitor actually gets removed.

      I'd rather this is logged inside of ReplicaSetMonitorManager::removeMonitor, when a ReplicaSetMonitor is actually removed, since it has the added benefit that it will be printed by all code paths that remove a ReplicaSetMonitor (e.g., addShard, removeShard):

      https://github.com/mongodb/mongo/blob/r3.4.0-rc1/src/mongo/client/replica_set_monitor_manager.cpp#L126-L128

            Assignee:
            esha.maharishi@mongodb.com Esha Maharishi (Inactive)
            Reporter:
            esha.maharishi@mongodb.com Esha Maharishi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: