[SERVER-11054] mergeChunks doesn't increment minor version correctly Created: 06/Oct/13  Updated: 11/Jul/16  Resolved: 13/Nov/13

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.5.2
Fix Version/s: 2.5.4

Type: Bug Priority: Major - P3
Reporter: Asya Kamsky Assignee: Randolph Tan
Resolution: Done Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Operating System: ALL
Steps To Reproduce:

> 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.

Participants:

 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.



 Comments   
Comment by Githook User [ 13/Nov/13 ]

Author:

{u'username': u'renctan', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-11054 mergeChunks doesn't increment minor version correctly
Branch: master
https://github.com/mongodb/mongo/commit/7688ccdf103191f89ed3c285889f9264dba48d8a

Generated at Thu Feb 08 03:24:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.