Hi folks,
On a mongodb version 2.6.3 running on RHEL5 (kernel 2.6.18-371.1.2.el5):
$ /usr/bin/mongod --version
db version v2.6.3
2015-03-27T09:52:08.242-0700 git version: 255f67a66f9603c59380b2a389e386910bbb52cb
we're seeing a warning logged along the lines of:
2015-03-23T10:54:05.535-0700 [conn5217423] warning: ClientCursor::staticYield can't unlock b/c of recursive lock ns: top: { opid: 1911578954, active: true, secs_running: 0, microsecs_running: 180, op: "query", ns: "marvin.resource", query: { findAndModify: "resource", query: { _id: "illudium_pu_36" }, update: { $push: {
updated.xyz: { m: "xyz", s: 0, c: 46826461, t: 1427133245176295897 } } }, upsert: true, new: true }, client: "
10.0.0.3:50085", desc: "conn5217423", threadId: "0x2b03f048c940", connectionId: 5217423, locks: { ^: "w", ^marvin: "W" }, waitingForLock: false, numYields: 0, lockStats: { timeLockedMicros: {}, timeAcquiringMicros: { r: 0, w: 5 } } }
My DBAs and I are looking to see what might be the matter with this,
whether or not there are indexes we need to adjust.
An example of the type of record that might be getting modified:
{
"_id" : "illudium_pu_36",
"deleted" : NumberLong("1371747182531748000"),
"modified" : null,
"updated" : {
"abc" : [
{
"m" : "abc",
"s" : NumberLong(0),
"c" : NumberLong(8),
"t" : NumberLong("1372793818142998603")
},
],
"def" : [
{
"m" : "sor",
"s" : NumberLong(0),
"c" : NumberLong(149),
"t" : NumberLong("1372793784242918479")
}
]
}
}
and an example of the type of findAndModify operation:
db.resource.findAndModify(
{
query: { "_id" : "illudium_pu_36" },
upsert: true,
new: true,
update: {
$push: {
"updated.abc": {
m: "abc",
s: NumberLong(0),
c: NumberLong(148),
t: NumberLong(1372793784242918478)
}
}
}
}
)
The query{} is covered by the default _id index:
db.resource.find( { _id : "illudium_pu_36"} ).explain()
{
"cursor" : "IDCursor",
"n" : 1,
"nscannedObjects" : 1,
"nscanned" : 1,
"indexOnly" : false,
"millis" : 0,
"indexBounds" : {
"_id" : [
[
"illudium_pu_36",
"illudium_pu_36"
]
]
},
"server" : "localhost:27017"
}
I came across this ticket:
that makes me think one solution is to update the database, but if
there are changes I can make to the indexes or to the query, I would
like to hear suggestions. For example, should I be creating some
sort of an index against updated.abc to alleviate the issue?
Everything I've read makes me think it is only the query{} I should
be concerned with, but that's automatically indexed so we're unclear
whether or not the $push target needs to be indexed some some fashion
as well.
Thank you,
Jim