Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9792

Wrong maxChunkSize on SplitVector w/ force

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 2.2.4, 2.4.3, 2.5.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Operating System:
      ALL

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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: