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

buildBottomUpPhases2And3 should check assertion code when detecting a dup

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 2.7.5
    • Index Maintenance, Storage
    • None
    • ALL

    Description

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

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: