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

removeShard incorrectly removes RSM monitor by shardId

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • CAR Team 2024-11-25

      A shard can be added with an arbitrary name. E.g. as tested in jstests/sharding/names.js, we can even add replicaSetA using as shard name replicaSetB, and the inverse, replicaSetB using as shard name replicaSetA.

      As a clean up step after removeShard, we call ReplicaSetMonitor::remove(name). But the name variable is not the replica set name, but the shard name. This can lead to incorrectly removing the RSM monitor for a shard which has not been removed. This was hidden by the fact that the balancer forces a ShardRegistry refresh in every round (SERVER-91974), and before SERVER-91121 because the ShardRegistry was periodically forcing a refresh.

            Assignee:
            yujin.kang@mongodb.com Yujin Kang Park
            Reporter:
            yujin.kang@mongodb.com Yujin Kang Park
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: