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

mergeChunks doesn't increment minor version correctly

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.5.4
    • 2.5.2
    • Sharding
    • ALL
    • Hide

      > sh.shardCollection("foo.bad",{_id:1})

      { "collectionsharded" : "foo.bad", "ok" : 1 }

      > sh.splitAt("foo.bad",{_id:0})

      { "ok" : 1 }

      > sh.splitAt("foo.bad",{_id:10})

      { "ok" : 1 }

      > sh.splitAt("foo.bad",{_id:20})

      { "ok" : 1 }

      > sh.moveChunk("foo.bad",{_id:-1},"shard0001")

      { "millis" : 32, "ok" : 1 }

      > sh.splitAt("foo.bad",{_id:15})

      { "ok" : 1 }

      > sh.splitAt("foo.bad",{_id:-15})

      { "ok" : 1 }

      > sh._adminCommand({mergeChunks:"foo.bad", bounds:[{_id:10},{_id:20}]})
      {
      "ok" : 0,
      "errmsg" : "could not merge chunks for foo.bad, writing to config failed :: caused by :: { errmsg: \"exception: Update validation failed: DuplicateKey E11000 duplicate key error index: config.chunks.$ns_1_lastmod_1 dup key: { : \"foo.bad\", : Timestamp 2000|4 }\", code: 11000, ok: 0.0 }"
      }

      Basically, split a chunk on first shard, then split a chunk on second shard, then try to merge the chuck you just split on the first shard.

      Show
      > sh.shardCollection("foo.bad",{_id:1}) { "collectionsharded" : "foo.bad", "ok" : 1 } > sh.splitAt("foo.bad",{_id:0}) { "ok" : 1 } > sh.splitAt("foo.bad",{_id:10}) { "ok" : 1 } > sh.splitAt("foo.bad",{_id:20}) { "ok" : 1 } > sh.moveChunk("foo.bad",{_id:-1},"shard0001") { "millis" : 32, "ok" : 1 } > sh.splitAt("foo.bad",{_id:15}) { "ok" : 1 } > sh.splitAt("foo.bad",{_id:-15}) { "ok" : 1 } > sh._adminCommand({mergeChunks:"foo.bad", bounds: [{_id:10},{_id:20}] }) { "ok" : 0, "errmsg" : "could not merge chunks for foo.bad, writing to config failed :: caused by :: { errmsg: \"exception: Update validation failed: DuplicateKey E11000 duplicate key error index: config.chunks.$ns_1_lastmod_1 dup key: { : \"foo.bad\", : Timestamp 2000|4 }\", code: 11000, ok: 0.0 }" } Basically, split a chunk on first shard, then split a chunk on second shard, then try to merge the chuck you just split on the first shard.

    Description

      Given two "merge-able" chunks of version X,Y and X,Z mergeChunks attempts to give the new resultant chunk version X,A where A is greater than minor version on that shard and fails when that minor version already exists on the other shard.

      This always happens when the next minor version is not on the same shard, but there won't be a noticeable failure if X,a happens to be available due to sequence of operations or if a is on the same shard as then we pick the "correct" max.

      Attachments

        Activity

          People

            randolph@mongodb.com Randolph Tan
            asya.kamsky@mongodb.com Asya Kamsky
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: