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

Mongos opCounter doesn't increase when last op causes the transaction to implicitly abort

    • Type: Icon: Task Task
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.1.5
    • Component/s: Sharding
    • Sharding

      This is because we throw an error here:
      https://github.com/mongodb/mongo/blob/r4.1.5/src/mongo/s/write_ops/batch_write_exec.cpp#L284

      so it will not reach this part of the code:
      https://github.com/mongodb/mongo/blob/r4.1.5/src/mongo/s/commands/cluster_write_cmd.cpp#L277

      This behavior is slightly different from other cases. Using insert with duplicate key error, here's a list of behavior as of master (roughtly v4.1.5):
      mongos, w/ transaction: opCounter for insert does not increment
      mongos, w/o transaction: opCounter for insert increments
      mongod, w/ transaction: opCounter for insert increments
      mongod, w/o transaction: opCounter for insert increments

            Assignee:
            backlog-server-sharding [DO NOT USE] Backlog - Sharding Team
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: