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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Incomplete
    • Affects Version/s: 3.6.1
    • Fix Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      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

      Description

      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.

        Attachments

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

          Activity

            People

            Assignee:
            mark.agarunov Mark Agarunov
            Reporter:
            travis@bryx.com Travis Brown
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: