-
Type: Bug
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: Sharding
-
Fully Compatible
-
ALL
-
Sharding 2020-06-15, Sharding 2020-06-29
-
5
This code checks split point boundaries for _configsvrCommitChunkSplit:
// Verify that splitPoints are not repeated >if (endKey.woCompare(startKey) == 0) { return {ErrorCodes::InvalidOptions, str::stream() << "Split on lower bound of chunk " << ChunkRange(startKey, endKey).toString() << "is not allowed"}; }
However, constructing a ChunkRange object with identical values is invalid, and is guaranteed to invariant in debug builds:
ChunkRange::ChunkRange(BSONObj minKey, BSONObj maxKey) : _minKey(std::move(minKey)), _maxKey(std::move(maxKey)) { dassert(SimpleBSONObjComparator::kInstance.evaluate(_minKey < _maxKey), str::stream() << "Illegal chunk range: " << _minKey.toString() << ", " << _maxKey.toString()); }
The error message should instead be constructed using startKey and endKey directly, ie:
return {ErrorCodes::InvalidOptions, str::stream() << "Split on lower bound of chunk [" << startKey.toString() << ", " << endKey.toString() << ") is not allowed"};