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

Race in hash_presplit.js

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.4.4, 2.5.0
    • Affects Version/s: 2.4.1
    • Component/s: Sharding
    • Labels:
    • ALL

      The js test contains 3 tests running on the same cluster. The first test creates a hashed sharded collection. The second test will do the same with numInitialChunks at 500. At the time of the second test, the race will cause the moveChunk to fail and result in the chunks not being evenly distributed across the shards.

      The race condition is as follows:
      1. First test moves the minKey->maxKey chunk from shard0001 to shard0000.
      2. fromShard (shard0001) tells toShard (shard0000) to commit and toShard sets the state to commit. The separate thread in toShard that is actually running the migration should see this change and terminate the thread. However, since this is on another thread, there is no guarantee on when this will exactly happen.
      3. Second test tries to do a moveChunk from shard0001 to shard0000 but it fails because the shard0000 hasn't completely set the migration status to not active.

      Note: this was causing the cause of this failure - http://buildlogs.mongodb.org/V2.4%20Linux%2064-bit/builds/27/test/sharding/hash_presplit.js

            randolph@mongodb.com Randolph Tan
            randolph@mongodb.com Randolph Tan
            0 Vote for this issue
            1 Start watching this issue