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

Remove drop2.js dependency on count scan yield behavior

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.12, 3.4.2, 3.5.2
    • Component/s: Storage
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.4, v3.2
    • Sprint:
      Query 2017-01-23
    • Linked BF Score:
      0

      Description

      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.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: