Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-1641

retryWrites causing index creation to fail

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Core
    • None

      Including retryWrites=true into the connection string is resulting in the following error when attempting to create an index:

      (node:24283) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): MongoError: The field 'retryWrites' is not valid for an index specification. Specification: { name: "x_1", key: { x: 1 }, retryWrites: true } 
      

      The mongod log file yields:

      2018-08-22T10:41:21.477-0500 I COMMAND  [conn49] command test.$cmd command: createIndexes { createIndexes: "documents", indexes: [ { name: "x_1", key: { x: 1 }, retryWrites: true } ], retryWrites: true, lsid: { id: UUID("6c12ec7f-990b-4f1b-bc43-8ddd39b1a2d2") }, $db: "test" } numYields:0 reslen:235 locks:{} protocol:op_query 0ms 
      

      It appears as if the retryWrites parameter is getting incorrectly applied to the createIndexes command (which then fails due to the stricter validation of index specifications). 

      This was perhaps introduced via NODE-1105.  However, I do not see index operations mentioned as a supported retryable write operation in the spec.

            Assignee:
            katherine.walker@mongodb.com Katherine Walker (Inactive)
            Reporter:
            christopher.harris@mongodb.com Chris Harris
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: