[SERVER-71281] opcounters.command on mongos counts insert, update and delete but opcounters.command on mongod doesn't Created: 11/Nov/22  Updated: 29/Oct/23  Resolved: 11/Nov/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2.0-rc0

Type: Task Priority: Major - P3
Reporter: Cheahuychou Mao Assignee: Cheahuychou Mao
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-71285 Add test coverage for sample rate dis... Closed
is depended on by COMPASS-6295 Investigate changes in SERVER-71281: ... Closed
is depended on by TOOLS-3218 Investigate changes in SERVER-71281: ... Closed
Related
is related to SERVER-66495 Aggregations should be counted as Que... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding NYC 2022-11-28
Participants:

 Description   

The serverStatus "opcounters" section contains the counts for for "insert", "update", "delete", "query" (find), "getmore" and "command" (all other operations). The documentation specifically notes that:

opcounters.command counts all commands except the write commands: insert, update, and delete

It turns out this statement is only true for mongod. Unlike mongod which marks insert, update and delete as shouldAffectCommandCounter(), mongos doesn't do that for ClusterWriteCmd.



 Comments   
Comment by Githook User [ 11/Nov/22 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}

Message: SERVER-71281 Make opcounters.command on mongos not count inserts, updates and deletes
Branch: master
https://github.com/mongodb/mongo/commit/654aa51fc14325b279b525900c814e4283bfe284

Generated at Thu Feb 08 06:18:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.