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

double counting data during chunk migrations

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • ALL

      I was running the new automated test for sharded aggregation, jstests/aggregation/testshard1.js. This can be run stand-alone from the shell via load('jstests/aggregation/testshard1.js');

      The first thing this test does is use a for loop to populate a collection which will them be used for the remainder of the test.

      While the test was starting up, in another window I started up another mongo shell (--port 30999, in order to talk to the mongos started by the shell's ShardingTest class), so I could keep an eye on the progress of loading the collection. Here's what I saw:

      $ ./mongo --port 30999
      MongoDB shell version: 2.1.1-pre-
      connecting to: 127.0.0.1:30999/test
      mongos> show dbs
      admin (empty)
      aggShard 0.15625GB
      config 0.0625GB
      mongos> use aggShard
      switched to db aggShard
      mongos> show collections
      system.indexes
      ts1
      mongos> db.ts1.count();
      53503
      mongos> db.ts1.count();
      200919
      mongos> db.ts1.count();
      202755
      mongos> db.ts1.count();
      200000

      The test script uploads 200000 items. There are no removes in the test script. Notice how the count overshoots, gets worse, and then hits the correct number; presumably migrations/balancing had stopped by then.

            Assignee:
            Unassigned Unassigned
            Reporter:
            cwestin Chris Westin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: