-
Type:
New Feature
-
Resolution: Done
-
Priority:
Critical - P2
-
Affects Version/s: 2.7.1
-
Component/s: Shell
-
None
-
0
-
None
-
None
-
None
-
None
-
None
-
None
Problem:
A test case can be defined thus
tests.push( { name: "Remove.IntId", pre: function( collection ) { collection.drop(); for ( var i = 0; i < 1000; i++ ) { collection.insert( { _id : i } ); } }, ops: [ { op: "insert", doc: { _id : { "#RAND_INT" : [ 0, 1000 ] } } }, { op: "remove", query: { _id : { "#RAND_INT" : [ 0, 1000 ] } } } ] } );
There are issues with this
1) A different random number is generated between the "insert" and "remove" steps - thus no guarantee that each step is operating on the same value.
2) As threads are added, there is the potential that data is removed by another thread before the second step executes, or the first step fails because another thread has just inserted that value.
- links to