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

on failed insert keysInserted should reset back to 0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • 4.4.6, 5.0.0-rc3
    • None
    • Logging
    • ALL
    • QE 2022-02-07, QE 2022-02-21, QE 2022-01-24

    Description

      In case insert fails I see this in the logs:

      command db.coll command: insert { insert: "coll", documents: [ { _id: ObjectId('59a656bad5362ae3447fe4d6'), foo:"bar" } ], writeConcern: { w: "majority" }, ordered: true, shardVersion: [ Timestamp 13000|1, ObjectId('57e430ce3487ce531ecab4ca') ] } ninserted:0 keysInserted:1 exception: E11000 duplicate key error collection: db.coll index: foo_1 dup key: { : "bar" } code:11000 numYields:0 reslen:465 locks:{ Global: { acquireCount: { r: 1, w: 1 } }, Database: { acquireCount: { w: 1 } }, Collection: { acquireCount: { w: 1 } } } protocol:op_command 168ms
      

      That keysInserted:1 is incorrect.

      Attachments

        Issue Links

          Activity

            People

              romans.kasperovics@mongodb.com Romans Kasperovics
              asya.kamsky@mongodb.com Asya Kamsky
              Votes:
              0 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: