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

stopMonitoringGuard in ShardingCatalogManagerImpl::addShard can remove an existing shard's ReplicaSetMonitor

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.4.0-rc1
    • Fix Version/s: 3.4.0-rc4
    • Component/s: Sharding
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Sharding 2016-11-21

      Description

      The stopMonitoringGuard

      https://github.com/mongodb/mongo/blob/r3.4.0-rc1/src/mongo/s/catalog/sharding_catalog_manager_impl.cpp#L742-L750

      is meant to remove the ReplicaSetMonitor for a new shard if the addShard() fails for any reason.

      However, if the shard attempting to be added has the same setName as an existing shard's setName, the stopMonitoringGuard will use the existing shard's ReplicaSetMonitor and, on error, will remove that existing shard's ReplicaSetMonitor.

      Potential fixes:

      1) Check if a ReplicaSetMonitor for the new shard's setName exists, and fail immediately if so.
      2) Make the stopMonitoringGuard only remove the ReplicaSetMonitor on failure if it actually created it (this seems less preferable - why would we ever want to use an existing ReplicaSetMonitor during addShard?).

        Attachments

          Activity

            People

            • Assignee:
              esha.maharishi Esha Maharishi
              Reporter:
              esha.maharishi Esha Maharishi
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: