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

buildBottomUpPhases2And3 should check assertion code when detecting a dup

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.7.5
    • Affects Version/s: None
    • Component/s: Index Maintenance, Storage
    • None
    • ALL

      The code listed below assumes that an AssertionException thrown by BtreeBuilder::addKey() is a dup key assertion (or a user interrupt) if dups are not allowed. If dropDups is on, assertions other than dup key assertions will incorrectly be treated as dup key assertions.

                  try {
                      if ( !dupsAllowed && dropDups ) {
                          LastError::Disabled led( lastError.get() );
                          btBuilder.addKey(d.first, d.second);
                      }
                      else {
                          btBuilder.addKey(d.first, d.second);                    
                      }
                  }
                  catch( AssertionException& e ) {
                      if ( dupsAllowed ) {
                          // unknown exception??
                          throw;
                      }
      
                      if( e.interrupted() ) {
                          killCurrentOp.checkForInterrupt();
                      }
      
                      if ( ! dropDups )
                          throw;
      
                      /* we could queue these on disk, but normally there are very few dups, so instead we
                          keep in ram and have a limit.
                      */
                      dupsToDrop.insert(d.second);
                      uassert( 10092 , "too may dups on index build with dropDups=true", dupsToDrop.size() < 1000000 );
                  }
      

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            aaron Aaron Staple
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: