summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-09-07 12:11:36 -0400
committerEliot Horowitz <eliot@10gen.com>2010-09-07 12:12:22 -0400
commitded8b8a3a498135ec4f84bcdaf98a80c8f04479b (patch)
treeacabab65a004d248e888ebb13e8c46b85d91a49a
parent81d318339fedb1f91fc48baa21e262e0cfddf58a (diff)
downloadmongo-ded8b8a3a498135ec4f84bcdaf98a80c8f04479b.tar.gz
don't check shard version twice for update and delete
-rw-r--r--db/client.cpp8
-rw-r--r--db/instance.cpp3
2 files changed, 10 insertions, 1 deletions
diff --git a/db/client.cpp b/db/client.cpp
index 9781041e067..48fe343988a 100644
--- a/db/client.cpp
+++ b/db/client.cpp
@@ -196,12 +196,18 @@ namespace mongo {
if ( doauth )
_auth( lockState );
- if ( _client->_curOp->getOp() != dbGetMore ){ // getMore's are special and should be handled else where
+ switch ( _client->_curOp->getOp() ){
+ case dbGetMore: // getMore's are special and should be handled else where
+ case dbUpdate: // update & delete check shard version in instance.cpp, so don't check here as well
+ case dbDelete:
+ break;
+ default: {
string errmsg;
if ( ! shardVersionOk( _ns , errmsg ) ){
msgasserted( StaleConfigInContextCode , (string)"[" + _ns + "] shard version not ok in Client::Context: " + errmsg );
}
}
+ }
}
void Client::Context::_auth( int lockState ){
diff --git a/db/instance.cpp b/db/instance.cpp
index ec3b793291c..f3b427a9e50 100644
--- a/db/instance.cpp
+++ b/db/instance.cpp
@@ -446,6 +446,7 @@ namespace mongo {
mongolock lk(1);
+ // if this ever moves to outside of lock, need to adjust check Client::Context::_finishInit
if ( ! broadcast && handlePossibleShardedMessage( m , 0 ) )
return;
@@ -472,8 +473,10 @@ namespace mongo {
}
writelock lk(ns);
+ // if this ever moves to outside of lock, need to adjust check Client::Context::_finishInit
if ( ! broadcast & handlePossibleShardedMessage( m , 0 ) )
return;
+
Client::Context ctx(ns);
long long n = deleteObjects(ns, pattern, justOne, true);