diff --git a/jstests/sharding/key_many.js b/jstests/sharding/key_many.js index 1850b0b..1b58e27 100644 --- a/jstests/sharding/key_many.js +++ b/jstests/sharding/key_many.js @@ -15,7 +15,7 @@ types = [ { name : "oid_other" , values : [ ObjectId() , ObjectId() , ObjectId() , ObjectId() , ObjectId() , ObjectId() ] , keyfield : "o" } , ] -s = new ShardingTest( "key_many" , 2 ); +s = new ShardingTest( { name: "key_many", shards: 2, other: { shardOptions: { verbose: 1 }}} ); s.setBalancer( false ) s.adminCommand( { enablesharding : "test" } ) @@ -153,11 +153,18 @@ for ( var i=0; igetCollection(nsString.ns()); if (!collection || (lifecycle && !lifecycle->canContinue())) { + + std::cout << "XXX ACM INVALID TRANSITION" << std::endl; uasserted(17270, "Update aborted due to invalid state transitions after yield."); } diff --git a/src/mongo/db/ops/update_lifecycle_impl.cpp b/src/mongo/db/ops/update_lifecycle_impl.cpp index a2e53fe..d4ae220 100644 --- a/src/mongo/db/ops/update_lifecycle_impl.cpp +++ b/src/mongo/db/ops/update_lifecycle_impl.cpp @@ -59,11 +59,18 @@ namespace mongo { return false; // Shard version must be compatible to continue + std::cout << "XXX ACM: called canContinue\n\n"; const CollectionMetadataPtr metadata = getMetadata(_nsString); const ChunkVersion shardVersion = metadata ? metadata->getShardVersion() : ChunkVersion::IGNORED(); - return (ChunkVersion::isIgnoredVersion(shardVersion) || - _shardVersion.isWriteCompatibleWith(shardVersion)); + std::cout << "XXX ACM shardVersion: " << shardVersion << std::endl; + std::cout << "XXX ACM _shardVersion: " << _shardVersion << std::endl; + const bool isIgnored = ChunkVersion::isIgnoredVersion(shardVersion); + std::cout << "XXX ACM in impl, isignored: " << isIgnored << std::endl; + const bool isWriteCompatible = _shardVersion.isWriteCompatibleWith(shardVersion); + std::cout << "XXX ACM in impl, isWriteCompatible: " << isWriteCompatible << std::endl; + return (isIgnored || isWriteCompatible); + return true; } const void UpdateLifecycleImpl::getIndexKeys(IndexPathSet* returnedIndexPathSet) const { diff --git a/src/mongo/s/chunk_version.h b/src/mongo/s/chunk_version.h index 3aac6eb..19da352 100644 --- a/src/mongo/s/chunk_version.h +++ b/src/mongo/s/chunk_version.h @@ -178,8 +178,13 @@ namespace mongo { // Can we write to this data and not have a problem? bool isWriteCompatibleWith( const ChunkVersion& otherVersion ) const { - if( ! hasCompatibleEpoch( otherVersion ) ) return false; - return otherVersion._major == _major; + const bool hasCompat = hasCompatibleEpoch( otherVersion ); + std::cout << "XXX ACM: hasCompat: " << hasCompat << std::endl; + if( ! hasCompat ) return false; + const bool isSameMajorVersion = ( +otherVersion._major == _major); + std::cout << "XXX ACM: isSameMajorVersion: " << isSameMajorVersion << std::endl; + return isSameMajorVersion; } // Is this the same version?