Docs Menu

clearJumboFlag

clearJumboFlag

Clears the jumbo flag for a chunk. To use the command, issue the clearJumboFlag command on a mongos instance.

이 명령은 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.

  • MongoDB Atlas: 클라우드에서의 MongoDB 배포를 위한 완전 관리형 서비스

중요

이 명령은 서버리스 인스턴스에서는 지원되지 않습니다. 자세한 내용은 지원되지 않는 명령을 참조하세요.

Th command has the following syntax:

db.adminCommand(
{
clearJumboFlag: "<database>.<collection>",
bounds: <array>
}
)

-또는-

// Cannot use for collections with hashed shard keys
db.adminCommand(
{
clearJumboFlag: "<database>.<collection>",
find: <query>
}
)

clearJumboFlag 명령은 다음 필드를 인수로 사용합니다.

필드
유형
설명

문자열

The namespace of the sharded 컬렉션 with the jumbo chunk(s).

Specify the collection's full namespace, including the database name (i.e. "<database>.<collection>")

배열

The exact bounds of a specific chunk. The array must consist of two documents that specify the lower and upper shard key values of a chunk to move:

[ { <shardKey> : <minValue> },{ <shardKey> : <maxValue> } ]

문서

A specific shard key and its value contained in the jumbo chunk.

{ <shardKey> : <value> }

On systems running with authorization, the user must have the clearJumboFlag privilege actions on the { db: "", collection: "" } resource.

The built-in role clusterManager provides the appropriate privileges.

The sh.status() includes the following sh.status.databases.<collection>.chunk-details for the test.jumbo collection.

... // Content omitted for brevity
test.jumbo
shard key: { "x" : 1 }
unique: false
balancing: true
chunks:
shardA 2
shardB 2
{ "x" : { "$minKey" : 1 } } -->> { "x" : 1 } on : shardB Timestamp(3, 0)
{ "x" : 1 } -->> { "x" : 2 } on : shardA Timestamp(6, 1) jumbo
{ "x" : 2 } -->> { "x" : 3 } on : shardA Timestamp(5, 1) jumbo
{ "x" : 3 } -->> { "x" : { "$maxKey" : 1 } } on : shardB Timestamp(6, 0)

The following clearJumboFlag command specifies the bounds of the { "x" : 1 } -->> { "x" : 2 } chunk:

db.adminCommand( {
clearJumboFlag: "test.jumbo",
bounds: [{ "x" : 1 }, { "x" : 2 }]
} )

Upon success, the command returns "ok": 1 in its output:

{
"ok" : 1,
"operationTime" : Timestamp(1580190080, 5),
"$clusterTime" : {
"clusterTime" : Timestamp(1580190080, 5),
"signature" : {
"hash" : BinData(0,"0cYT49s72MHUYV1F2WpoEwlyeVs="),
"keyId" : NumberLong("6786859092951433239")
}
}
}

The following clearJumboFlag command specifies the 찾기 field to find the chunk that contains the shard key { "x" : 2 } :

db.adminCommand( {
clearJumboFlag: "test.jumbo",
find: { "x" : 2 }
} )

Upon success, the command returns "ok": 1 in its output:

{
"ok" : 1,
"operationTime" : Timestamp(1580191819, 5),
"$clusterTime" : {
"clusterTime" : Timestamp(1580191819, 5),
"signature" : {
"hash" : BinData(0,"N6x6drN7HUq5MR5ezUJns1rfeqY="),
"keyId" : NumberLong("6786859092951433239")
}
}
}

To verify the operation, run sh.status() again. The jumbo flag should no longer appear in its output.

... // Content omitted for brevity
test.jumbo
shard key: { "x" : 1 }
unique: false
balancing: true
chunks:
shardA 2
shardB 2
{ "x" : { "$minKey" : 1 } } -->> { "x" : 1 } on : shardB Timestamp(3, 0)
{ "x" : 1 } -->> { "x" : 2 } on : shardA Timestamp(7, 0)
{ "x" : 2 } -->> { "x" : 3 } on : shardA Timestamp(8, 0)
{ "x" : 3 } -->> { "x" : { "$maxKey" : 1 } } on : shardB Timestamp(6, 0)

The sh.status() includes the following sh.status.databases.<collection>.chunk-details for the test.jumboHashed collection. The collection uses a hashed shard key.

... // Content omitted for brevity
test.jumboHashed
shard key: { "x" : "hashed" }
unique: false
balancing: true
chunks:
shardA 2
shardB 2
{ "x" : { "$minKey" : 1 } } -->> { "x" : NumberLong(0) } on : shardA Timestamp(1, 0)
{ "x" : NumberLong(0) } -->> { "x" : NumberLong("848411777775835583") } on : shardA Timestamp(4, 0)
{ "x" : NumberLong("848411777775835583") } -->> { "x" : NumberLong("5902408780260971510") } on : shardB Timestamp(4, 1) jumbo
{ "x" : NumberLong("5902408780260971510") } -->> { "x" : { "$maxKey" : 1 } } on : shardB Timestamp(2, 2)

To clear the jumbo flag for a chunk if the collection uses a 해시 샤드 키, use clearJumboFlag with the bounds field:

db.adminCommand( {
clearJumboFlag: "test.jumboHashed",
bounds: [{ "x" : NumberLong("848411777775835583") }, { "x" : NumberLong("5902408780260971510") }]
} )

Upon success, the command returns "ok": 1 in its output:

{
"ok" : 1,
"operationTime" : Timestamp(1580194290, 5),
"$clusterTime" : {
"clusterTime" : Timestamp(1580194290, 5),
"signature" : {
"hash" : BinData(0,"nWCqOYVrab7NEGHWoo2NYENqHR4="),
"keyId" : NumberLong("6786875525496307742")
}
}
}

To verify the operation, run sh.status() again. The jumbo flag should no longer appear in its output.

... // Content omitted for brevity
test.jumboHashed
shard key: { "x" : "hashed" }
unique: false
balancing: true
chunks:
shardA 2
shardB 2
{ "x" : { "$minKey" : 1 } } -->> { "x" : NumberLong(0) } on : shardA Timestamp(1, 0)
{ "x" : NumberLong(0) } -->> { "x" : NumberLong("848411777775835583") } on : shardA Timestamp(4, 0)
{ "x" : NumberLong("848411777775835583") } -->> { "x" : NumberLong("5902408780260971510") } on : shardB Timestamp(5, 0)
{ "x" : NumberLong("5902408780260971510") } -->> { "x" : { "$maxKey" : 1 } } on : shardB Timestamp(2, 2)

다음도 참조하세요.