buildBottomUpPhases2And3 should check assertion code when detecting a dup

XMLWordPrintableJSON

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

      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 Stearn
            Reporter:
            Aaron Staple (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: