On this page本页内容
To run, issue the command against the 要运行,请针对admin database:admin数据库发出命令:
db.adminCommand( { lockInfo: 1 } )
The following is an example of the output from the 以下是lockInfo:lockInfo的输出示例:
{
"lockInfo" : [
{
"resourceId" : "{2305843009213693953: ParallelBatchWriterMode, 1}",
"granted" : [
{
"mode" : "IS",
"convertMode" : "NONE",
"enqueueAtFront" : false,
"compatibleFirst" : false,
"debugInfo" : "{ findandmodify: \"hugeindex\", query: { _id: 585.0 }, update: { $pop: { a: 1.0 } }, upsert: false, new: false, lsid: { id: UUID(\"dc611138-04c6-49b1-a7ac-161040dd9d65\") }, $db: \"test\" }",
"clientInfo" : {
"desc" : "conn3",
"connectionId" : 3,
"client" : "127.0.0.1:55165",
"opid" : 28770
}
}
],
"pending" : [ ]
},
{
"resourceId" : "{6917529027641081857: Global, 1}",
"granted" : [
{
"mode" : "IX",
"convertMode" : "NONE",
"enqueueAtFront" : false,
"compatibleFirst" : false,
"debugInfo" : "{ findandmodify: \"hugeindex\", query: { _id: 585.0 }, update: { $pop: { a: 1.0 } }, upsert: false, new: false, lsid: { id: UUID(\"dc611138-04c6-49b1-a7ac-161040dd9d65\") }, $db: \"test\" }",
"clientInfo" : {
"desc" : "conn3",
"connectionId" : 3,
"client" : "127.0.0.1:55165",
"opid" : 28770
}
},
{
"mode" : "IX",
"convertMode" : "NONE",
"enqueueAtFront" : false,
"compatibleFirst" : false,
"debugInfo" : "index build: 29d48366-63ad-41e2-a689-69255a89c094",
"clientInfo" : {
"desc" : "IndexBuildsCoordinatorMongod-0",
"opid" : 27437
}
}
],
"pending" : [ ]
},
{
"resourceId" : "{4611686018427387905: ReplicationStateTransition, 1}",
"granted" : [
{
"mode" : "IX",
"convertMode" : "NONE",
"enqueueAtFront" : false,
"compatibleFirst" : false,
"debugInfo" : "{ findandmodify: \"hugeindex\", query: { _id: 585.0 }, update: { $pop: { a: 1.0 } }, upsert: false, new: false, lsid: { id: UUID(\"dc611138-04c6-49b1-a7ac-161040dd9d65\") }, $db: \"test\" }",
"clientInfo" : {
"desc" : "conn3",
"connectionId" : 3,
"client" : "127.0.0.1:55165",
"opid" : 28770
}
},
{
"mode" : "IX",
"convertMode" : "NONE",
"enqueueAtFront" : false,
"compatibleFirst" : false,
"debugInfo" : "index build: 29d48366-63ad-41e2-a689-69255a89c094",
"clientInfo" : {
"desc" : "IndexBuildsCoordinatorMongod-0",
"opid" : 27437
}
}
],
"pending" : [ ]
},
{
"resourceId" : "{10123292395995783581: Database, 899920359141007773, test}",
"granted" : [
{
"mode" : "IX",
"convertMode" : "NONE",
"enqueueAtFront" : false,
"compatibleFirst" : false,
"debugInfo" : "{ findandmodify: \"hugeindex\", query: { _id: 585.0 }, update: { $pop: { a: 1.0 } }, upsert: false, new: false, lsid: { id: UUID(\"dc611138-04c6-49b1-a7ac-161040dd9d65\") }, $db: \"test\" }",
"clientInfo" : {
"desc" : "conn3",
"connectionId" : 3,
"client" : "127.0.0.1:55165",
"opid" : 28770
}
},
{
"mode" : "IX",
"convertMode" : "NONE",
"enqueueAtFront" : false,
"compatibleFirst" : false,
"debugInfo" : "index build: 29d48366-63ad-41e2-a689-69255a89c094",
"clientInfo" : {
"desc" : "IndexBuildsCoordinatorMongod-0",
"opid" : 27437
}
}
],
"pending" : [ ]
},
{
"resourceId" : "{12576221391967629173: Collection, 1047006345899159413, test.hugeindex}",
"granted" : [
{
"mode" : "IX",
"convertMode" : "NONE",
"enqueueAtFront" : false,
"compatibleFirst" : false,
"debugInfo" : "{ findandmodify: \"hugeindex\", query: { _id: 585.0 }, update: { $pop: { a: 1.0 } }, upsert: false, new: false, lsid: { id: UUID(\"dc611138-04c6-49b1-a7ac-161040dd9d65\") }, $db: \"test\" }",
"clientInfo" : {
"desc" : "conn3",
"connectionId" : 3,
"client" : "127.0.0.1:55165",
"opid" : 28770
}
},
{
"mode" : "IX",
"convertMode" : "NONE",
"enqueueAtFront" : false,
"compatibleFirst" : false,
"debugInfo" : "index build: 29d48366-63ad-41e2-a689-69255a89c094",
"clientInfo" : {
"desc" : "IndexBuildsCoordinatorMongod-0",
"opid" : 27437
}
}
],
"pending" : [ ]
}
],
"ok" : 1
}
lockInfo An array of documents that report on the lock information. 报告锁信息的文档数组。Each document includes:每份文件包括:
lockInfo.granted An array of documents. 一系列文档。Each document provides information on locks that are currently granted on the resource.每个文档都提供有关当前授予资源的锁的信息。
lockInfo.pending An array of documents. 一系列文档。Each document provides information on locks that are currently pending on the resource.每个文档都提供了有关资源上当前挂起的锁的信息。
For each 对于每个granted or pending lock document, information include:granted或pending的锁定文档,信息包括:
mode |
| ||||||||||
convertMode | |||||||||||
enqueueAtFront | |||||||||||
compatibleFirst | |||||||||||
debugInfo | |||||||||||
clientInfo |