Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-8028

The many-collection-test does not run when a task is not configured

    • 2

      When doing tests while investigating WT-8025, I wanted to run many-collection-test on an existing database and I could not.

      Reproducing the error:

      Run the script with clean-and-populate task
      ...
      Run the script again without specifying the task 

      The script needs to be corrected to:

      • Allow the task input argument to be undefined
      • Not exit if a variable is undefined

      Another issue I faced is when the replica set was being initialized by the test while it was already set up:

      pymongo.errors.OperationFailure: already initialized, full error: {'ok': 0.0, 'errmsg': 'already initialized', 'code': 23, 'codeName': 'AlreadyInitialized', '$clusterTime': {'clusterTime': Timestamp(1630462114, 1), 'signature': {'hash': b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'keyId': 0}}, 'operationTime': Timestamp(1630462114, 1)}

      To correct this, we need to fix the condition when setup_mongodb() is called. We are calling it if oplog is set to True which seems wrong. It should be called when populate is set to True. This makes me think that the oplog variable can be fully removed as it is not used anywhere else.

      Suggested fixes:

      --- a/largescale/many-collection-test.py
      +++ b/largescale/many-collection-test.py
      @@ -784,7 +784,7 @@ override_from_environ()
       # Start MongDB.
       client = MongoClient(conn_str)
       # Set up MongoDB.
      -if oplog:
      +if populate:
           setup_mongodb()
       
       docs_per = int(working_set_docs / num_collections)
      diff --git a/largescale/run_many_coll.sh b/largescale/run_many_coll.sh
      index 93579ab..d1bddfc 100755
      --- a/largescale/run_many_coll.sh
      +++ b/largescale/run_many_coll.sh
      @@ -3,7 +3,7 @@
       # A script to prepare test environment and execute many collections testing.
       #
       
      -set -eux
      +set -ex
       
       usage () {
           cat << EOF
      @@ -17,7 +17,7 @@ Arguments:
       EOF
       }
       
      -if [ $# -lt 3 ] || [ "$1" == "-h" ]; then
      +if [ $# -lt 4 ] || [ "$1" == "-h" ]; then
           usage
           exit
       fi 

      Definition of done:

      Make sure the test can run with and without specifying the task name.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            etienne.petrel@mongodb.com Etienne Petrel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: