diff options
Diffstat (limited to 's/d_state.cpp')
-rw-r--r-- | s/d_state.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/s/d_state.cpp b/s/d_state.cpp index 16f46cd..3f13b79 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; @@ -549,7 +549,7 @@ namespace mongo { if ( version == 0 && clientVersion > 0 ){ stringstream ss; - ss << "version: " << version << " clientVersion: " << clientVersion; + ss << "collection was dropped or this shard no longer valied version: " << version << " clientVersion: " << clientVersion; errmsg = ss.str(); return false; } @@ -565,6 +565,13 @@ namespace mongo { return false; } + if ( isWriteOp && version.majorVersion() == clientVersion.majorVersion() ){ + // this means there was just a split + // since on a split w/o a migrate this server is ok + // going to accept write + return true; + } + stringstream ss; ss << "your version is too old ns: " + ns << " global: " << version << " client: " << clientVersion; errmsg = ss.str(); |