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

StreamableReplicaSetMonitor registers a new topology listener per call to getHostsOrRefresh

    • Fully Compatible
    • ALL
    • v5.0, v4.4
    • Service Arch 2021-03-22
    • 4

      Whenever StreamableReplicaSetMonitor::getHostsOrRefresh is called (which happens on every query), if the result isn't immediately available, we enqueue a query object for that host, to be resolved when the host becomes available. As part of enqueuing a query, we unconditionally register the query processor as an event listener for topology changes. We only remove that listener when all outstanding queries are satisfied, but that won't happen as long as the node the RSM is targeting is down or unable to be contacted. Registering a listener does not do any deduplication to check whether the passed-in pointer is the same, which means the list of listeners will continue to grow as long as there are new queries. It also means that every time there's a topology change event, ALL of those listeners will then call requestImmediateCheck.

       

      We should change it so that the RSM _queryProcessor topology listener is only registered at most once.

            Assignee:
            lamont.nelson@mongodb.com Lamont Nelson
            Reporter:
            matthew.saltz@mongodb.com Matthew Saltz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: