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

XMLWordPrintableJSON

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

      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 Tan
              Reporter:
              Randolph Tan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: