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

mapReduce sharded output replace does not fully split

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.5.5
    • Component/s: MapReduce, Sharding
    • Labels:
    • ALL

      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.

            Assignee:
            randolph@mongodb.com Randolph Tan
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: