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

StorageTimestampTests depends on oplog batch writer thread scheduling

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.9.0, 4.4.5
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.4
    • Sprint:
      Execution Team 2020-10-19
    • Linked BF Score:
      16

      Description

      The SecondarySetWildcardIndexMultikeyOnInsert test case tries to "coerce" the oplog batch writer into interleaving operations in a certain way:

      // Coerce oplog application to apply op2 before op1.
              std::vector<repl::OplogEntry> ops = {op0, op2, op1};
      

      Unfortunately, the batch applier splits up operations across many threads based on a hash of _id and a runtime-randomized seed, so this coercion is fruitless. If op1 and op2 end up in the same batch, they will be inserted in the same transaction, which will return this error from WiredTiger: "commit timestamp <op1> older than the first commit timestamp <op2>", and trigger this fatal assertion in MongoDB.

      This test needs to be rewritten so that it does not batch out-of-order operations together or depend on thread synchronization.

      Bonus! Because of the way the hash seed is randomized to split up operations to 16 different threads, the probability of this test putting op2 and op1 in the same batch is 1/16. So theoretically this test will fail 6.25% of the time it is run.

        Attachments

          Activity

            People

            Assignee:
            louis.williams Louis Williams
            Reporter:
            louis.williams Louis Williams
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: