diff --git a/db/client.cpp b/db/client.cpp index 5208cf50d69..2cef211d6d7 100644 --- a/db/client.cpp +++ b/db/client.cpp @@ -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 ); } } diff --git a/s/d_logic.cpp b/s/d_logic.cpp index ddf83e84ef0..6840935c90b 100644 --- a/s/d_logic.cpp +++ b/s/d_logic.cpp @@ -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; } diff --git a/s/d_logic.h b/s/d_logic.h index 0f7ba3507e5..a000f6ba830 100644 --- a/s/d_logic.h +++ b/s/d_logic.h @@ -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 diff --git a/s/d_state.cpp b/s/d_state.cpp index 16f46cdb9d2..d40d1618d15 100644 --- a/s/d_state.cpp +++ b/s/d_state.cpp @@ -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;