Uploaded image for project: 'PHP Legacy Driver'
  1. PHP Legacy Driver
  2. PHP-1077

Fix handling of timeout options for createIndexes command

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.5.1
    • Fix Version/s: 1.5.2
    • Component/s: pecl-mongo
    • Labels:
      None
    • # Replies:
      4
    • Last comment by Customer:
      true
    • Sprint:
      Sprint 1 - April 14 - May 2

      Description

      We currently do not document wTimeoutMS (and the deprecated wtimeout alias) for ensureIndex() and createIndex(). This is probably reasonable, as the option doesn't make much sense for index builds. It will never interrupt the primary index build, and only counts time for write propagation to secondaries. Since this is handled in append_getlasterror(), the option only applies to versions of MongoDB 2.5.5, which perform insertions on system.indexes. It does not apply to the createIndexes command, so we should either ignore or emit a notice or warning when it is used.

      socketTimeoutMS (and the deprecated timeout alias) happen to work for work for both old and new methods. For legacy inserts, which use GLE, append_getlasterror() will end up parsing the options; however, the command variant only processes the deprecated timeout option. The mongo_collection_create_index_command() function attempts to strip timeout from the createIndexes command document, so it is only passed to php_mongo_runcommand further down in the function. It doesn't pick up socketTimeoutMS, which means that might end up in an index spec. Additionally, the current code merges options to index_spec, but then attempts to delete the key post-merge from index_spec. At some point, those lines must have gotten out of sync.

      As for maxTimeMS, we currently do not document this at all. It only applies to the command variant, so we should inform users that it only applies to MongoDB 2.6 in the documentation.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jmikola Jeremy Mikola
              Reporter:
              jmikola Jeremy Mikola
              Participants:
              Last commenter:
              Jeremy Mikola
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                6 years, 15 weeks, 1 day ago
                Date of 1st Reply: