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

Race condition in ttl1.js

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.0.15, 3.2.0-rc4
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • Fully Compatible
    • ALL
    • v3.0
    • 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(); }
    • QuInt C (11/23/15)

      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

            Assignee:
            geert.bosch@mongodb.com Geert Bosch
            Reporter:
            geert.bosch@mongodb.com Geert Bosch
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: