[SERVER-12227] allow moving of chunk by _id vs find or bounds Created: 31/Dec/13  Updated: 06/Dec/22  Resolved: 06/Dec/18

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

Type: Bug Priority: Major - P3
Reporter: Kenny Gorman Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Sharding
Operating System: ALL
Participants:

 Description   

We want to be able to select a specific chunk from config.chunks and move it explicitly vs having to construct a bounds or find command. For instance:

 
db.chunks.findOne();
{
	"_id" : "testme.testme-_id_MinKey",
	"lastmod" : Timestamp(28, 0),
	"lastmodEpoch" : ObjectId("52c322fd84dab9fabf34992b"),
	"ns" : "testme.testme",
	"min" : {
		"_id" : { "$minKey" : 1 }
	},
	"max" : {
		"_id" : NumberLong("-7378697629483820640")
	},
	"shard" : "REPLSET_60007"
}
 
x = {	"moveChunk" : "testme.testme",
	"_id": "testme.testme-_id_MinKey",
	"to" : "REPLSET_60005"
}
db.runCommand(x);
 



 Comments   
Comment by Greg Studer [ 07/Mar/14 ]

The _id is only as unique as the namspace and "min" key - it's constructed from those fields. The lastmod and lastmodEpoch are actually the unique identifiers.

If you're trying to select by _id, doing a find with the min key will give you the same selectivity (and this is what we do in our tests).

Comment by Kenny Gorman [ 04/Jan/14 ]

It's not that it's easier. The way I suggested is completely deterministic. We want to specify the exact chunk we want vs specifying a query that returns one or more chunks.

Comment by Eliot Horowitz (Inactive) [ 04/Jan/14 ]

Just curious why that's easier than using min and find?

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