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

do not pass empty metadata to shouldStopFetching()

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Replication
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Repl 2017-02-13, Repl 2017-04-17, Repl 2017-05-08
    • 0

      In OplogFetcher::_callback(), we check to see if the query response actually has metadata, and set a boolean hasMetadata.
      However, later on in the function, we blindly call shouldStopFetching() and pass the metadata, regardless of hasMetadata-ness.

      This results in some erroneous behavior. In particular, you can get stuck in a tight CPU loop when chaining is turned off, because the node will choose what it believes to be a primary, but immediately afterwards, TopologyCoordinatorImpl::shouldChangeSyncSource() will return true, since the metadata config version (it's null) will not match the current config version. Repeat in a tight loop.

      You can see the effects of this on the log here:
      https://logkeeper.mongodb.org/build/7419231f517600f1d972ad9bc50cb45b/test/582a071abe07c472fe0b4a36
      This tight loop appears to be part of the reason why the test suite failed (a replica set lost quorum due to slow heartbeats).

            Assignee:
            siyuan.zhou@mongodb.com Siyuan Zhou
            Reporter:
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: