Wrong maxChunkSize on SplitVector w/ force

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.2.4, 2.4.3, 2.5.0
    • Component/s: None
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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;
      }
      

            Assignee:
            Unassigned
            Reporter:
            James Wahlin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: