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

Extend benchRun store and retrieve values

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Done
    • Icon: Critical - P2 Critical - P2
    • 2.7.7
    • 2.7.1
    • Shell

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: