Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-1547

Inline cluster rescans must be concurrent/done by monitor

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.7.0.rc0
    • Affects Version/s: None
    • Component/s: Spec Comp

      https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#requesting-an-immediate-check

      Currently when there is a retryable error, for example, the cluster is scanned synchronously on the main thread. This is the same behavior that was eliminated in RUBY-1357 during client construction and suffers from the same problems:

      • Rescan is done on all servers, main thread is blocked while each server is queried even though topology may already have identified a writable server.
      • Servers are scanned sequentially.
      • There is no time bound on the rescan.

      A solution similar to RUBY-1357 needs to be implemented for all of the other rescans. One way to do this I imagine is to request an immediate server recheck for all servers and then wait up to server selection timeout to obtain a usable server.

      One difficulty here is the monitor thread is currently not designed to be interruptible - it unconditionally sleeps for the heartbeat interval time. This will need to be changed.

      Pseudocode in the spec: https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#monitor-thread

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: