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:
parent
29f89df775
commit
e2c5acbe4b
@ -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 );
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user