[SERVER-9792] Wrong maxChunkSize on SplitVector w/ force Created: 28/May/13  Updated: 28/May/13  Resolved: 28/May/13

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.2.4, 2.4.3, 2.5.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: James Wahlin Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-9365 mongod always split at 250000 position Closed
Related
Operating System: ALL
Participants:

 Description   

When the splitVector command is run with force==true we set maxChunkSize to the size of the collection. From the comment preceding this code it appears we meant to set maxChunkSize to the size of the chunk we want to split.

Setting maxChunkSize to collection size can lead to an imbalanced split, which in the case of large chunks (larger than chunksize in config.settings) could mean a split where the left side of the split remains large and the right size is very small (potentially a single document).

The relevant code is the following in s/d_split.cpp:

NamespaceDetails *d = nsdetails( ns );
...
const long long dataSize = d->stats.datasize;
...
BSONElement forceElem = jsobj[ "force" ];
 
if ( forceElem.trueValue() ) {
    force = true;
    maxChunkSize = dataSize;
}


Generated at Thu Feb 08 03:21:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.