[SERVER-1776] mongos counting bulk insert as 1 op WAS: mongostat shows different insert data when connecting to mongos versus single primary in single rep set Created: 11/Sep/10  Updated: 29/May/12  Resolved: 29/Nov/11

Status: Closed
Project: Core Server
Component/s: Admin, Sharding
Affects Version/s: 1.7.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Alvin Richards (Inactive) Assignee: Brandon Diamond
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

ec2 / ubuntu 10.04


Operating System: ALL
Participants:

 Description   

Problem:
I'm inserting a bunch of data and seeign different results from mongostat depending on what I connect to.

Configuration is
– single mongos
– single replset, with a single mongod
– single config

If I connect to the mongos with mongostat I see the following reported

vero:10gen$ ./software/mongodb-osx-x86_64-1.6.0/bin/mongostat --port 27500 --host ec2-67-202-19-63.compute-1.amazonaws.com
connected to: ec2-67-202-19-63.compute-1.amazonaws.com:27500
insert/s query/s update/s delete/s getmore/s command/s mapped vsize res faults/s locked % idx miss % conn time
3 0 0 0 0 3 0 166 14 0 0 0 3 17:17:27
2 0 0 0 0 1 0 166 14 0 0 0 3 17:17:28
2 0 0 0 0 2 0 166 14 0 0 0 3 17:17:29

However, if I connect to the single mongod I see the following

insert/s query/s update/s delete/s getmore/s command/s flushes/s mapped vsize res faults/s locked % idx miss % q t|r|w conn time
16327 0 0 0 0 3 0 8349 8633 5743 0 32.9 0 0|0|0 8 17:18:16
16383 0 0 0 0 2 0 8349 8633 5747 0 29.5 0 0|0|0 8 17:18:17
13617 0 0 0 0 3 0 8349 8633 5743 0 42 0 0|0|0 8 17:18:18
10867 0 0 0 0 3 0 8349 8633 5747 0 28.2 0 0|0|0 8 17:18:19

These latter figures match the I see from doing a db.collection.count()

Reproduce:

  • Setup the following
    • one config server
    • one replset, with a single mongod
    • one config server
  • Start a bulk insert through the mongos
  • run mongostat on the mongos
  • run mongostat on the mongod
  • compair the results

Business Case:

  • User Expereince


 Comments   
Comment by Brandon Diamond [ 28/Nov/11 ]

In reading over your ticket a bit more closely, I noticed that you appear to be using version 1.6: "./software/mongodb-osx-x86_64-1.6.0/bin/mongostat"

The problem you are reporting appears to have been fixed in the most recent version of MongoDB. Please upgrade to 2.0.1.

Comment by Brandon Diamond [ 21/Nov/11 ]

I've attempted to reproduce this bug by (1) repeatedly performing bulk insert using pymongo (i.e., db.collection.insert([large array of objects])) against a local mongos, (2) running mongostat against mongos, (3) running mongostat against the primary in the shard, and (4) comparing the output of both. The mongos exhibits more inserts (presumably due to the oplog and sharding) but the overall total is comparable to the inserts at the primary.

Are you still able to reproduce the problem?

Generated at Thu Feb 08 02:58:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.