[SERVER-8917] buildBottomUpPhases2And3 should check assertion code when detecting a dup Created: 08/Mar/13  Updated: 01/Sep/14  Resolved: 13/Aug/14

Status: Closed
Project: Core Server
Component/s: Index Maintenance, Storage
Affects Version/s: None
Fix Version/s: 2.7.5

Type: Bug Priority: Major - P3
Reporter: Aaron Staple Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-8242 assertion failures (btree) during repair Closed
Tested
Operating System: ALL
Participants:

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



 Comments   
Comment by Githook User [ 13/Aug/14 ]

Author:

{u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: SERVER-13951 Split index building in to UnitOfWork-sized stages

All index builds now go through the MultiIndexBuilder as its API was already
close to ideal. The following tickets have also been addressed by this commit:

SERVER-14710 Remove dropDups
SERVER-12309 Cloner build indexes in parallel
SERVER-14737 Initial sync uses bg index building
SERVER-9135 fast index build for initial sync
SERVER-2747 can't kill index in phase 2
SERVER-8917 check error code rather than assuming all errors are dups
SERVER-14820 compact enforces unique while claiming not to
SERVER-14746 IndexRebuilder should be foreground and fail fatally
Branch: master
https://github.com/mongodb/mongo/commit/00913e47de5aced5267e44e82ac9e976bbaac089

Generated at Thu Feb 08 03:18:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.