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

Fix race in too_stale_secondary.js

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.1
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • Fully Compatible
    • ALL
    • Repl 2019-08-12
    • 7

      I think there is a race in the test. The test waits for a node to be in RECOVERING state because of "too stale". However, when a node starts up, it always go through RECOVERING state as part of the start up process. The intention of the test is to ensure that a secondary that has gone "too stale" will transition back to RECOVERING from SECONDARY state. But simply waiting for RECOVERING state is problematic because we can't tell whether RECOVERING is part of start up or is because of "too stale". If the node is still in RECOVERING as part of the startup, the subsequent assert(tooStale(replTest.nodes[2])); would fail. I think "too stale" implies that the node is in RECOVERING. A fix would be to assert.soon on tooStale() and then ensure the node is in RECOVERING state.

            Assignee:
            lingzhi.deng@mongodb.com Lingzhi Deng
            Reporter:
            lingzhi.deng@mongodb.com Lingzhi Deng
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: