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

Shard::containsNode does not check whether ReplicaSetMonitor::get returns null

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.4.0-rc0
    • Affects Version/s: 2.3.1
    • Component/s: Sharding
    • Labels:
      None
    • ALL

      Code in question:

              if ( _cs.type() == ConnectionString::SET ) {
                  ReplicaSetMonitorPtr rs = ReplicaSetMonitor::get( _cs.getSetName(), true );
                  return rs->contains( node );
              }
      

      All other places that calls ReplicaSetMonitor::get checks whether it is null or not. One particular case this can be null is when the shard has been removed. Another possible scenario is would be when the shard was newly added, in particular, the case when StaticShardInfo adds the lookup entry for the replica set before the ReplicaSetMonitor has been initialized.

            Assignee:
            randolph@mongodb.com Randolph Tan
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: