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

Investigate changes in SERVER-26726: Check number of arguments for createIndex() and throw error if more than two arguments

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: manual, Server
    • Labels:
      None

      Description

      Description

      Downstream Change Summary

      Added validation of number of arguments for shell functions ensureIndex, createIndex and createIndexes. Arguments handling or functions behaviour is not changed.

      Description of Linked Ticket

      If a third argument is passed to the ensureIndex() with valid options, then the behavior is to ignore the third argument instead of an error. So for example, if I execute the following

      db.myColl.ensureIndex( { my_date: 1}, {expireAfterSeconds: 2678400},{background: true, sparse: true } ) 
      

      the third argument which is critical to the purpose of this index build is completely ignored and the index is built in the foreground with no sparse option. This can lead to catastrophic events if myColl is very large and foreground index was not a choice. Can this be fixed so a user is not punished for accidentally passing the critical options as a third argument in the index build? The version we tried this is 3.2.9

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              backlog-server-pm Backlog - DB Eng Program Management Team
              Participants:
              Last commenter:
              Andrew Feierabend
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Days since reply:
                8 weeks, 4 days ago
                Date of 1st Reply: