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

Wrong maxChunkSize on SplitVector w/ force

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

      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 Unassigned
            Reporter:
            james.wahlin@mongodb.com James Wahlin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: