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

Race condition in ttl1.js

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.15, 3.2.0-rc4
    • Component/s: Storage
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.0
    • Steps To Reproduce:
      Hide

      Apply the following patch and run the jstests/noPassthroughWithMongod/ttl1.js test:

      diff --git a/src/mongo/db/exec/delete.cpp b/src/mongo/db/exec/delete.cpp
      index dfb9c9b..7cdb514 100644
      --- a/src/mongo/db/exec/delete.cpp
      +++ b/src/mongo/db/exec/delete.cpp
      @@ -212,6 +212,7 @@ PlanStage::StageState DeleteStage::work(WorkingSetID* out) {
               if (!_params.isExplain) {
                   WriteUnitOfWork wunit(getOpCtx());
                   _collection->deleteDocument(getOpCtx(), rloc);
      +            sleepmillis(50);
                   wunit.commit();
               }
       
      

      Show
      Apply the following patch and run the jstests/noPassthroughWithMongod/ttl1.js test: diff --git a/src/mongo/db/exec/delete.cpp b/src/mongo/db/exec/delete.cpp index dfb9c9b..7cdb514 100644 --- a/src/mongo/db/exec/delete.cpp +++ b/src/mongo/db/exec/delete.cpp @@ -212,6 +212,7 @@ PlanStage::StageState DeleteStage::work(WorkingSetID* out) { if (!_params.isExplain) { WriteUnitOfWork wunit(getOpCtx()); _collection->deleteDocument(getOpCtx(), rloc); + sleepmillis(50); wunit.commit(); }
    • Sprint:
      QuInt C (11/23/15)

      Description

      The test waits until the TTL monitor starts deleting documents, and then right away checks that all documents have been deleted. Usually it will, because deleting a handful of documents takes so little time. Additionally, on MMAPv1 the exclusive lock will typically avoid access before the TTL thread completes. However a race exists. After talking with Kamran, the best solution seems to add another assert.soon.

      https://evergreen.mongodb.com/task/mongodb_mongo_master_windows_64_2k8_noPassthroughWithMongod_WT_8a3acb42742182c5e314636041c2df368232bbc5_15_11_03_15_56_46

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: