moveChunk with compound shared key

Hi, i have an issue trying to move a chunk from one shard to another, the shard key is compound, next the info:

db.adminCommand({ listShards: 1 })
{
			"_id" : "shard0",
			"host" : "shard0/centos661:27119,centos7:27117,centos72:27118",
			"state" : 1
		},
		{
			"_id" : "shard1",
			"host" : "shard1/centos661:27129,centos7:27127,centos72:27128",
			"state" : 1
		}
sh.status()
{  "_id" : "test",  "primary" : "shard1",  "partitioned" : true,  "version" : {  "uuid" : UUID("e56c2c42-127f-40a1-ae22-1981ea4eaf43"),  "lastMod" : 1 } }
                test.colshard
                        shard key: { "a" : 1, "b" : 1 }
                        unique: false
                        balancing: true
                        chunks:
                                shard1	7
                        { "a" : { "$minKey" : 1 }, "b" : { "$minKey" : 1 } } -->> { "a" : 2, "b" : 2 } on : shard1 Timestamp(1, 1) 
                        { "a" : 2, "b" : 2 } -->> { "a" : 29128, "b" : 29128 } on : shard1 Timestamp(1, 2) 
                        { "a" : 29128, "b" : 29128 } -->> { "a" : 43691, "b" : 43691 } on : shard1 Timestamp(1, 4) 
                        { "a" : 43691, "b" : 43691 } -->> { "a" : 60002, "b" : 60002 } on : shard1 Timestamp(1, 5) 
                        { "a" : 60002, "b" : 60002 } -->> { "a" : 74565, "b" : 74565 } on : shard1 Timestamp(1, 7) 
                        { "a" : 74565, "b" : 74565 } -->> { "a" : 95002, "b" : 95002 } on : shard1 Timestamp(1, 8) 
                        { "a" : 95002, "b" : 95002 } -->> { "a" : { "$maxKey" : 1 }, "b" : { "$maxKey" : 1 } } on : shard1 Timestamp(1, 9) 

i want to move some of them from shard1 to shard0, i execute:

mongos> sh.moveChunk(“test.colshard”, { “a” : 29128, “b” : 43691 } , “shard0” )

"ok" : 0,
"errmsg" : "Data transfer error: migrate failed: InvalidUUID: Cannot create collection test.colshard because we already have an identically named collection with UUID f2ea3a92-4e1f-4c99-bd6a-7d2761d7f4c7, which differs from the donor's UUID 0135eb74-74e1-4d87-a5ca-eb3febe6c9c0. Manually drop the collection on this shard if it contains data from a previous incarnation of test.colshard",
"code" : 96,

what is wrong?, thanks for you help

This doesn’t have anything to do with compound shard key but rather with the fact that you already have some artifacts of collection with the same name on the other shard.

What’s the history of this cluster? Any idea why such a collection would have existed on the other shard?

Asya

1 Like