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

Remove drop2.js dependency on count scan yield behavior

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.2.12, 3.4.2, 3.5.2
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • Fully Compatible
    • ALL
    • v3.4, v3.2
    • Query 2017-01-23
    • 0

      The drop2.js test command can fail in particular atypical timing of the parallel shells.

      drop2.js uses a count command with a infinite $where clause in order to block a drop operation so that we may check whether killOp can be used on the drop collection command. We believe this test is attempting to confirm that we are able to issue a killOp on a drop collection command, but that the operation is not interrupted, which prior to SERVER-1818 could leave the database in an inconsistent state.

      On a correct execution, the count command acquires a read lock on the collection, preventing it from being dropped. However, if the count command yields, it releases the collection lock. This allowed the collection to drop before we can observe it in the currentOp output in drop2.js.

      max.hirschhorn suggests that we rewrite this test in order to:

      1. Issue a fsyncLock command.
      2. Execute a drop collection, wait until the currentOp output indicates it is waiting for locks.
      3. Issue a killOp for the drop operation.
      4. Issue fsyncUnlock.
      5. Check that the drop operation was not killed, and that the collection was dropped successfully.

      This removes the dependency on the yielding behavior of the count command. We have inspected the code path and confirmed that the only call to checkForInterrupt() during the execution of a drop command is here, before the drop command attempts to acquire locks here.

            kyle.suarez@mongodb.com Kyle Suarez
            david.hatch David Hatch
            0 Vote for this issue
            4 Start watching this issue