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

StorageTimestampTests depends on oplog batch writer thread scheduling

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0, 4.4.5
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • v4.4
    • Execution Team 2020-10-19
    • 16

      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.

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

              Created:
              Updated:
              Resolved: