Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-10053

currentOp example for finding index ops needs 3.4 update

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 3.4.0
    • Fix Version/s: None
    • Component/s: manual
    • Labels:
      None
    • # Replies:
      4
    • Last comment by Customer:
      true
    • Sprint:
      KANBAN BUCKET

      Description

      I discovered that the example command to find Active Indexing Operations using currentOp didn't work for me recently when I was working with 3.4.

      It's a pretty helpful for finding long-running index builds in support cases, so I encourage that we keep this example, but update it to be compatible with all currently supported versions.

      The difference is that the "op" value in 3.4 has changed. On a standalone or primary node it used to be "query", but in 3.4 it's changed to being "command" (which makes more sense).

      It seems that the oplog docs are maintaining the appearance of being inserts to the system.indexes collection, even in 3.4. So we still need the second line so index builds can be found whilst they are being run via replication sync on secondaries. However I found that the "op" value has again changed: from "insert" to "none".

      So for both of the clauses inside the outer $or operation we need $in arrays to accept two types of "op" each. New solution shown below.

      db.currentOp(
           {       $or: [
               { op: { $in: [ "command", "query" ] }, "query.createIndexes": { $exists: true } }, //"op" used to be "query" in =< 3.2, is now "command" in 3.4
               { op: { $in: [ "insert", "none" ] }, ns: /\.system\.indexes\b/ }  //This is a legacy form?. It is still used in oplog so that is how it manifests on the secondary
             ]
           } )
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              allison.moore Allison Reinheimer Moore
              Reporter:
              akira.kurogane Akira Kurogane
              Participants:
              Last commenter:
              Kay Kim (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                3 years, 1 week, 2 days ago
                Date of 1st Reply: