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

mapReduce sharded output replace does not fully split

    XMLWordPrintable

    Details

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

      Description

      The reason for lies in here:

      https://github.com/mongodb/mongo/blob/r2.5.5/src/mongo/s/commands_public.cpp#L1790-1804

                          // do the splitting round
                          ChunkManagerPtr cm = confOut->getChunkManagerIfExists( finalColLong );
                          for ( map<BSONObj, int>::iterator it = chunkSizes.begin() ; it != chunkSizes.end() ; ++it ) {
                              BSONObj key = it->first;
                              int size = it->second;
                              verify( size < 0x7fffffff );
       
                              // key reported should be the chunk's minimum
                              ChunkPtr c =  cm->findIntersectingChunk(key);
                              if ( !c ) {
                                  warning() << "Mongod reported " << size << " bytes inserted for key " << key << " but can't find chunk" << endl;
                              } else {
                                  c->splitIfShould( size );
                              }
                          }

      Note that mongos calls Chunk::splitIfShould, which performs a split with only a single split point. This means that if the resulting chunk is multiples larger than the chunk size, a small section of the chunk will be split into a new chunk. For example, if chunkSize is 1 and resulting chunk is 5, the split operation will split the chunk into size 1 and size 4.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              renctan Randolph Tan
              Reporter:
              renctan Randolph Tan
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: