- 
    Type:
Bug
 - 
    Resolution: Done
 - 
    Priority:
Major - P3
 - 
    Affects Version/s: 2.6.3
 - 
    Component/s: Index Maintenance
 
- 
        Fully Compatible
 - 
        ALL
 - 
        
 - 
        (copied to CRM)
 - 
        None
 
- 
        None
 - 
        None
 - 
        None
 - 
        None
 - 
        None
 - 
        None
 
When a node is performing initial sync in 2.6.3 it will build indexes using the method specified by the original index build command even though the node does not become a viable SECONDARY until the index builds are complete.
Eg.
2014-07-31T13:22:29.077+1000 [rsSync] replSet initial sync clone all databases
2014-07-31T13:22:29.089+1000 [rsSync] replSet initial sync cloning db: test
...
2014-07-31T13:22:36.059+1000 [rsSync] build index on: test.ts properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "test.ts" }
2014-07-31T13:22:36.059+1000 [rsSync] 	 building index using bulk method
2014-07-31T13:22:42.870+1000 [rsSync] build index done.  scanned 2000000 total records. 6.81 secs
2014-07-31T13:22:43.030+1000 [rsSync] replSet initial sync cloning db: admin
2014-07-31T13:22:43.045+1000 [rsSync] replSet initial sync data copy, starting syncup
2014-07-31T13:22:43.045+1000 [rsSync] oplog sync 1 of 3
2014-07-31T13:22:43.382+1000 [rsSync] oplog sync 2 of 3
2014-07-31T13:22:43.382+1000 [rsSync] replSet initial sync building indexes
2014-07-31T13:22:43.382+1000 [rsSync] replSet initial sync cloning indexes for : test
2014-07-31T13:22:43.384+1000 [rsSync] build index on: test.ts properties: { v: 1, key: { server: 1.0, cpu: 1.0, ts: 1.0 }, name: "server_1_cpu_1_ts_1", ns: "test.ts", background: true }
2014-07-31T13:22:43.384+1000 [rsSync] 	 building index in background
2014-07-31T13:22:43.878+1000 [rsBackgroundSync] replSet syncing to: localhost:27118
2014-07-31T13:22:43.879+1000 [rsBackgroundSync] replset setting syncSourceFeedback to localhost:27118
2014-07-31T13:22:46.000+1000 [rsSync] 		Index Build(background): 390700/2000000	19%
2014-07-31T13:22:49.000+1000 [rsSync] 		Index Build(background): 808100/2000000	40%
...
I would expect the node to either build indexes using the foreground process or allow the node to enter SECONDARY status.
- related to
 - 
                    
SERVER-21100 InitialSync finishes before indexes finish building
-         
 - Closed
 
 -         
 - 
                    
SERVER-65818 [5.0] Initial sync uses hybrid index building
-         
 - Closed
 
 -