[SERVER-15809] Shard Tags trump RemoveShard command Created: 27/Oct/14  Updated: 07/Apr/23  Resolved: 05/Dec/14

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.6.3, 2.6.5
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Jason Ford Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

When removing a shard from a cluster where tags have been assigned to that particular shard, the removeShard admin command will not remove chunks that fall within that tag range.

This is resolvable by removing the shard tag from that shard, and assigning to one (or more) other shards, at which point the balancer takes care of removing the remaining chunks.

I'm not sure if this behavior is intended, but I would have assumed that the removeShard command would "trump" the shard tags.



 Comments   
Comment by Ramon Fernandez Marina [ 05/Dec/14 ]

Hi fordjp, apologies for the late reply. This is the expected behavior: unless some other shards are tagged with the same tags the balancer can't know where to put these chunks. The mongos logs show more details:

2014-12-05T17:24:53.963-0500 [Balancer] distributed lock 'balancer/tab:27017:1417817884:1804289383' acquired, ts : 548230b500d46ee8f4cab525
2014-12-05T17:24:53.979-0500 [Balancer] chunk { _id: "test.foo-x_1000.0", lastmod: Timestamp 1000|4, lastmodEpoch: ObjectId('54822f9200d46ee8f4cab4f2'), ns: "test.foo", min: { x: 1000.0 }, max: { x: MaxKey }, shard: "shard01" } is not on a shard with the right tag: S02
2014-12-05T17:24:53.979-0500 [Balancer] no where to put it :(
2014-12-05T17:24:53.979-0500 [Balancer] no available shards to take chunks for tag [S02]
2014-12-05T17:24:53.980-0500 [Balancer] distributed lock 'balancer/tab:27017:1417817884:1804289383' unlocked. 

For these chunks to be moveable to a different shard, the tags of the shard you're removing need to exist on other shards.

Regards,
Ramón.

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