summaryrefslogtreecommitdiff
path: root/src/mongo/s/collection_metadata.cpp
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2014-04-02 18:31:50 -0400
committerRandolph Tan <randolph@10gen.com>2014-04-03 15:42:28 -0400
commitbc26f73ef697c844cde8e4561bbf9a9c2f4728be (patch)
tree4dfa661cfed295e3a58123ee71487b270f465a4e /src/mongo/s/collection_metadata.cpp
parent789097cb1823b849e6598ac8e4a3ecff9befd682 (diff)
downloadmongo-bc26f73ef697c844cde8e4561bbf9a9c2f4728be.tar.gz
SERVER-12638 Sharding chunks ranges overlap
Diffstat (limited to 'src/mongo/s/collection_metadata.cpp')
-rw-r--r--src/mongo/s/collection_metadata.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/s/collection_metadata.cpp b/src/mongo/s/collection_metadata.cpp
index e3e42e84a2b..0a57b78c520 100644
--- a/src/mongo/s/collection_metadata.cpp
+++ b/src/mongo/s/collection_metadata.cpp
@@ -130,6 +130,8 @@ namespace mongo {
return NULL;
}
+ invariant( chunk.getMin().woCompare(chunk.getMax()) < 0 );
+
// Check that there isn't any chunk on the interval to be added.
if ( rangeMapOverlaps( _chunksMap, chunk.getMin(), chunk.getMax() ) ) {
@@ -337,7 +339,7 @@ namespace mongo {
for ( vector<BSONObj>::const_iterator it = splitKeys.begin(); it != splitKeys.end();
++it ) {
BSONObj split = *it;
- dassert(split.woCompare(startKey) > 0);
+ invariant(split.woCompare(startKey) > 0);
metadata->_chunksMap[startKey] = split.getOwned();
metadata->_chunksMap.insert( make_pair( split.getOwned(), chunk.getMax().getOwned() ));
metadata->_shardVersion.incMinor();