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

Race in recover_prepared_transactions_startup_secondary_application.js

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 4.2.0-rc2
    • Fix Version/s: None
    • Component/s: Replication
    • Labels:
      None
    • Operating System:
      ALL
    • Linked BF Score:
      0

      Description

      recover_prepared_transactions_startup_secondary_application.js prepares a transaction, then restarts a secondary and queries it, expecting it to be in state SECONDARY. Sometimes the query fails, however, with "node is recovering". This is due to a race in the test. The test thinks that waiting for the prepare entry to be majority-committed implies that the restarted node has transitioned to state SECONDARY, but this is not always so.

      * Create a 2-node set
      * Prepare a transaction
      * In either order:
          * The secondary restarts & transitions to RECOVERING
          * The prepare entry is majority-committed
      * The test waits for the prepare entry to be majority-committed
      * The test queries the restarted node
      

      If the secondary restarts before the prepare is majority-committed, then waiting for the majority commit is the same as waiting for the restarted node to become SECONDARY, so querying the node is fine.

      If the secondary restarts after the prepare is majority-committed, then waiting for the majority commit is insufficient. The node could still be in RECOVERING and reject the query.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jesse A. Jesse Jiryu Davis
              Reporter:
              jesse A. Jesse Jiryu Davis
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: