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

make prepare_conflict.js more robust

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.8
    • Affects Version/s: None
    • Component/s: Replication
    • Labels:
      None
    • Fully Compatible
    • Repl 2019-02-11
    • 0

      This came out of BF-11662.

      prepare_conflict.js tests that when we attempt to read a document that a prepared transaction modified, it returns a prepare conflict. We do this by checking if a find command times out with the MaxTimeMSExpired error code. We then parse the profiler for the slow find command and make sure there's a prepare conflict.

      The current timeout is 1 second. It is possible that the operation can time out while waiting for a collection level X lock, which is held by the prepared transaction. If it times out before it can acquire the lock, the find will not return a prepare conflict.

      There are a few solutions we could try to address this issue:
      1. Increase the timeout to account for slow machines (maybe 5 seconds)
      2. Remove the parsing of the profiler log line and assume that if the find timed out, it would have run into a prepare conflict.
      3. Introduce a fail point where if the command times out because of a prepare conflict, return a prepare conflict error. This way, we can explicitly check for this error code instead of checking for MaxTimeMSExpired.

            Assignee:
            pavithra.vetriselvan@mongodb.com Pavithra Vetriselvan
            Reporter:
            pavithra.vetriselvan@mongodb.com Pavithra Vetriselvan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: