-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Index Maintenance, Write Ops
-
None
-
ALL
The update implementation determines if a mod is indexed using the set of index keys present when the operation begins running. If an index is added while the update operation yields, fields present in the new index may not be identified as indexed and an in place update on these fields may be applied improperly.
Test:
// If an index is added while an update operation is yielding, the updated documents should be // indexed correctly. t = db.jstests_updatel; t.drop(); // Insert some { a:0 } values. for( i = 0; i < 50000; ++i ) { t.save( { a:0 } ); } db.getLastError(); p = startParallelShell( // Wait until the update operation (below) begins running. 'while( db.jstests_updatel.find( { a:1 } ).limit( -1 ).itcount() == 0 );' + // Add an index on { a:1 }. 'db.jstests_updatel.ensureIndex( { a:1 } );' ); // Update all documents to { a:1 }. t.update( {}, { $set: { a:1 } }, false, true ); p(); // Check that the { a:1 } index contains all { a:1 } values. assert.eq( 50000, t.find( { a:1 } ).hint( { a:1 } ).itcount() );
- is duplicated by
-
SERVER-5755 Invalid BSONObj size: ... 0xEEEEEEEE when deleting
- Closed
- is related to
-
SERVER-5755 Invalid BSONObj size: ... 0xEEEEEEEE when deleting
- Closed