-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Index Maintenance, Replication, Write Ops
-
None
-
ALL
When an array based operator is applied to a field that is absent, the replicated operation checks that the field matches null. If there is a sparse index on the field, the operation may not be replicated properly.
Test
function doTest( sparse ) { rt = new ReplTest( "repl14tests" ); m = rt.start( true ); mc = m.getDB( 'd' )[ 'c' ]; mc.ensureIndex( {a:1}, {sparse:sparse} ); mc.save( {} ); s = rt.start( false ); sc = s.getDB( 'd' )[ 'c' ]; assert.soon( function() { return sc.count() > 0; } ); mc.update( {}, {$push:{a:1}} ); assert.soon( function() { return sc.count( {a:1} ) > 0; } ); rt.stop(); } doTest( false ); doTest( true );
- is related to
-
SERVER-4781 replica set initial sync failure when update cannot be applied to a future version of an object received via clone
- Closed
-
SERVER-12071 updates from oplog must use _id or do a table scan
- Closed
- related to
-
SERVER-8225 slow replication and long write locks caused by capped collection without _id field and index, affects 2.2.2 but not 2.0.4
- Closed