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

v2.6 query plan ranking test "NonCoveredIxisectFetchesLess" relies on order of deleted record list

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.6.11, 3.1.5
    • Affects Version/s: 2.6.4
    • Component/s: Querying
    • Fully Compatible
    • ALL
    • Quint Iteration 5

      The following patch to v2.6 PlanRankingTest::All::setupTests() causes the NonCoveredIxisectFetchesLess test to fail (see example failure).

      This test has been disabled in master, but exists in v2.6. I propose removing it entirely, in master and v2.6.

      diff --git a/src/mongo/dbtests/plan_ranking.cpp b/src/mongo/dbtests/plan_ranking.cpp
      index 02efa06..2e49e36 100644
      --- a/src/mongo/dbtests/plan_ranking.cpp
      +++ b/src/mongo/dbtests/plan_ranking.cpp
      @@ -833,20 +833,20 @@ namespace PlanRankingTests {
                   add<PlanRankingIntersectWithBackup>();
                   add<PlanRankingPreferCovered>();
                   add<PlanRankingAvoidIntersectIfNoResults>();
                   add<PlanRankingPreferCoveredEvenIfNoResults>();
                   add<PlanRankingPreferImmediateEOF>();
      +            add<PlanRankingPreferImmediateEOFAgainstHashed>();
                   add<PlanRankingNoCollscan>();
                   add<PlanRankingCollscan>();
                   add<PlanRankingIxisectCovered>();
                   add<PlanRankingIxisectNonCovered>();
                   add<PlanRankingNonCoveredIxisectFetchesLess>();
                   add<PlanRankingIxisectHitsEOFFirst>();
                   add<PlanRankingChooseBetweenIxisectPlans>();
                   add<PlanRankingAvoidBlockingSort>();
                   add<PlanRankingWorkPlansLongEnough>();
                   add<PlanRankingAccountForKeySkips>();
      -            add<PlanRankingPreferImmediateEOFAgainstHashed>();
               }
           } planRankingAll;
      
       }  // namespace PlanRankingTest
      

      I believe that success of the "NonCoveredIxisectFetchesLess" test relies on the DiskLoc order of the documents inserted in the collection (I believe that the first document having the smallest DiskLoc is the necessary condition, but I haven't investigated fully). In the failure scenario, I observe the intersection plan losing to one of the single-index plans because the AND_SORTED stage spent almost all of its work cycles advancing one of its two children. In the success scenario, I observe the intersection plan winning, and the AND_SORTED stage advancing both of its children approximately an equal amount. I infer that the value of the stage's first saved "targetLoc" explains the difference between these two executions.

      The failure occurs only when all suites are run; the failure does not occur when just the plan ranking suite is run.

            Assignee:
            qingyang.chen Qingyang Chen
            Reporter:
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: