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

add indexes to config.locks and lockpings collection for large numbers of sharded collections

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.4.10, 2.6.0-rc0
    • Affects Version/s: None
    • Component/s: Performance
    • None

      Issue Status as of March 31, 2014

      ISSUE SUMMARY

      For certain use cases, the number of sharded collections can grow to such a number that distributed locking slows due to lack of indexes over the lock entries in the config database.

      USER IMPACT

      Sharding operations that require distributed locks (like splitting and moving chunks) can be delayed or blocked on systems with a very large number of sharded collections.

      SOLUTION

      The fix is to add indexes to the config.locks and config.lockpings collections to make these queries faster.

      WORKAROUNDS

      Affected users can create the indexes manually. The indexes to create are:

      config.locks: { ts : 1 }
      config.locks: { state : 1, process : 1 }
      config.lockpings: { ping : 1 }
      

      Limiting the number of sharded collections per cluster or deploying more performant hardware for config servers can also alleviate the problem.

      AFFECTED VERSIONS

      All recent production release versions up to 2.4.9 are affected.

      PATCHES

      The fix is included in the 2.4.10 production release and the 2.5.5 development version, which will evolve into the 2.6.0 production release.

      Original Description

      For certain use cases, the number of sharded collections can grow to such a number that distributed locking slows due to lack of indexes over the lock entries.

      Add default indexes to the distributed locks collection to make lock queries fast.

            Assignee:
            greg_10gen Greg Studer
            Reporter:
            greg_10gen Greg Studer
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: