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

on failed insert keysInserted should reset back to 0

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.4.6, 5.0.0-rc3
    • Component/s: Logging
    • ALL
    • QE 2022-02-07, QE 2022-02-21, QE 2022-01-24

      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.

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

              Created:
              Updated:
              Resolved: