0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 00:56:44 +01:00

add if op is write to shardVersionOk definition prep for SERVER-1473

This commit is contained in:
Eliot Horowitz 2010-08-24 23:59:51 -04:00
parent 29f89df775
commit e2c5acbe4b
4 changed files with 4 additions and 4 deletions

View File

@ -199,7 +199,7 @@ namespace mongo {
if ( _client->_curOp->getOp() != dbGetMore ){ // getMore's are special and should be handled else where
string errmsg;
if ( ! shardVersionOk( _ns , errmsg ) ){
if ( ! shardVersionOk( _ns , lockState > 0 , errmsg ) ){
msgasserted( StaleConfigInContextCode , (string)"[" + _ns + "] shard version not ok in Client::Context: " + errmsg );
}
}

View File

@ -56,7 +56,7 @@ namespace mongo {
DbMessage d(m);
const char *ns = d.getns();
string errmsg;
if ( shardVersionOk( ns , errmsg ) ){
if ( shardVersionOk( ns , opIsWrite( op ) , errmsg ) ){
return false;
}

View File

@ -155,7 +155,7 @@ namespace mongo {
/**
* @return true if the current threads shard version is ok, or not in sharded version
*/
bool shardVersionOk( const string& ns , string& errmsg );
bool shardVersionOk( const string& ns , bool write , string& errmsg );
/**
* @return true if we took care of the message and nothing else should be done

View File

@ -523,7 +523,7 @@ namespace mongo {
* @ return true if not in sharded mode
or if version for this client is ok
*/
bool shardVersionOk( const string& ns , string& errmsg ){
bool shardVersionOk( const string& ns , bool isWriteOp , string& errmsg ){
if ( ! shardingState.enabled() )
return true;