Aggregation on secondary server is not using the same index as the primary

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Incomplete
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.6.1
    • Component/s: Aggregation Framework
    • None
    • ALL
    • Hide

      Upgrade to 3.6.1
      Run this query with the read preference set to primary
      Run this query with the read preference set to secondaryPreferred

      Show
      Upgrade to 3.6.1 Run this query with the read preference set to primary Run this query with the read preference set to secondaryPreferred
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      On our development server, I upgraded from 3.6.0 to 3.6.1, and one of our aggregation queries started taking about 30s. I ran the profiler on both the primary and secondary, and noticed that it was using a different index on the secondary. On the primary, the correct index is used, on the secondary, it is not. I could solve this problem by adding an additional index, but this is not ideal. The results from the profiling on the primary (fast.js) and secondary (slow.js) are attached.

        1. explain_primary_without_new_index.txt
          38 kB
          Travis Brown
        2. explain_secondary_with_new_index.txt
          105 kB
          Travis Brown
        3. explain_secondary_without_new_index.txt
          105 kB
          Travis Brown
        4. fast.js
          5 kB
          Travis Brown
        5. indexDetails.png
          31 kB
          Travis Brown
        6. primary_without_new_index.log
          9 kB
          Travis Brown
        7. secondary_with_new_index.log
          9 kB
          Travis Brown
        8. secondary_without_new_index.log
          11 kB
          Travis Brown
        9. slow.js
          5 kB
          Travis Brown

            Assignee:
            Mark Agarunov (Inactive)
            Reporter:
            Travis Brown
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: