-
Type: Task
-
Resolution: Won't Do
-
Priority: 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