make locks for queries more fine-grained
This commit is contained in:
12
db/query.cpp
12
db/query.cpp
@@ -801,11 +801,11 @@ namespace mongo {
|
||||
qr->startingFrom = 0;
|
||||
qr->nReturned = n;
|
||||
}
|
||||
else {
|
||||
/* regular query */
|
||||
|
||||
AuthenticationInfo *ai = currentClient.get()->ai;
|
||||
uassert( 10106 , "unauthorized", ai->isReadOnlyAuthorized(c.database()->name.c_str()));
|
||||
else { /* regular query */
|
||||
mongolock lk(false); // read lock
|
||||
Client::Context ctx( ns , dbpath , &lk );
|
||||
AuthenticationInfo *ai = c.ai;
|
||||
uassert( 10106 , "unauthorized", ai->isReadOnlyAuthorized(ctx.db()->name.c_str()));
|
||||
|
||||
/* we allow queries to SimpleSlave's -- but not to the slave (nonmaster) member of a replica pair
|
||||
so that queries to a pair are realtime consistent as much as possible. use setSlaveOk() to
|
||||
@@ -976,7 +976,7 @@ namespace mongo {
|
||||
qr->startingFrom = 0;
|
||||
qr->nReturned = n;
|
||||
}
|
||||
}
|
||||
} // end else for regular query
|
||||
|
||||
int duration = t.millis();
|
||||
bool dbprofile = curop.shouldDBProfile( duration );
|
||||
|
||||
Reference in New Issue
Block a user