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

    • Type: Icon: Bug Bug
    • Resolution: Incomplete
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.6.1
    • Component/s: Aggregation Framework
    • Labels:
      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

      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. slow.js
          5 kB
        2. secondary_without_new_index.log
          11 kB
        3. secondary_with_new_index.log
          9 kB
        4. primary_without_new_index.log
          9 kB
        5. indexDetails.png
          indexDetails.png
          31 kB
        6. fast.js
          5 kB
        7. explain_secondary_without_new_index.txt
          105 kB
        8. explain_secondary_with_new_index.txt
          105 kB
        9. explain_primary_without_new_index.txt
          38 kB

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

              Created:
              Updated:
              Resolved: