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

StreamableReplicaSetMonitor registers a new topology listener per call to getHostsOrRefresh

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v5.0, v4.4
    • Sprint:
      Service Arch 2021-03-22
    • Case:
    • Story Points:
      4

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            lamont.nelson Lamont Nelson
            Reporter:
            matthew.saltz Matthew Saltz
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            16 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: