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

Wait for initial sync to clear state before asserting 'replSetGetStatus' reply has no 'initialSync' field

    XMLWordPrintable

Details

    • Fully Compatible
    • ALL
    • v5.0, v4.4, v4.2
    • Repl 2021-07-12
    • 24

    Description

      initial_sync_replSetGetStatus.js waits for the initial syncing node to transition into SECONDARY state and then assert the 'replSetGetStatus' command reply does not contain 'initialSync'  field. However it's possible that the node transitioned to SECONDARY state during the onCompletion callback before resetting the _initialSyncState. When responding to the 'replsetGetStatus' command, if _initialSyncState is not reset, the response will still include the `initialSyncStatus` field, causing the assertion to fail. One solution is to add a fail point after resetting _initialSyncState and wait in the test. Another option can be using assert.soon(), but using fail point can test it a more deterministic manner.

      Attachments

        Activity

          People

            wenbin.zhu@mongodb.com Wenbin Zhu
            wenbin.zhu@mongodb.com Wenbin Zhu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: