Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-15064

Extend benchRun store and retrieve values

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 2.7.7
    • Affects Version/s: 2.7.1
    • Component/s: Shell
    • Labels:

      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.

            Assignee:
            alvin Alvin Richards (Inactive)
            Reporter:
            alvin Alvin Richards (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: