ROOTPLOIT
Server: LiteSpeed
System: Linux in-mum-web1878.main-hosting.eu 5.14.0-570.21.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 11 07:22:35 EDT 2025 x86_64
User: u435929562 (435929562)
PHP: 7.4.33
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/go/pkg/mod/go.mongodb.org/[email protected]/testdata/transactions/legacy/reads.yml
runOn:
    -
        minServerVersion: "4.0"
        topology: ["replicaset"]
    -
        minServerVersion: "4.1.8"
        topology: ["sharded"]

database_name: &database_name "transaction-tests"
collection_name: &collection_name "test"

data: &data
  - {_id: 1}
  - {_id: 2}
  - {_id: 3}
  - {_id: 4}

tests:
  - description: collection readConcern without transaction

    operations:
      - name: find
        object: collection
        collectionOptions:
          readConcern:
            level: majority
        arguments:
          session: session0
        result: *data

    expectations:
      - command_started_event:
          command:
            find: *collection_name
            readConcern:
              level: majority
            lsid: session0
            txnNumber:
            startTransaction:
            autocommit:
          command_name: find
          database_name: *database_name

    outcome: &outcome
      collection:
        data:
          *data

  - description: find

    operations:
      - &startTransaction
        name: startTransaction
        object: session0
      - &find
        name: find
        object: collection
        arguments:
          session: session0
          batchSize: 3
        result: *data
      - *find
      - &commitTransaction
        name: commitTransaction
        object: session0

    expectations:
      - command_started_event:
          command:
            find: *collection_name
            batchSize: 3
            readConcern:
            lsid: session0
            txnNumber:
              $numberLong: "1"
            startTransaction: true
            autocommit: false
          command_name: find
          database_name: *database_name
      - command_started_event:
          command:
            getMore:
              # 42 is a fake placeholder value for the cursorId.
              $numberLong: '42'
            collection: *collection_name
            batchSize: 3
            lsid: session0
            txnNumber:
              $numberLong: "1"
            startTransaction:
            autocommit: false
          command_name: getMore
          database_name: *database_name
      - command_started_event:
          command:
            find: *collection_name
            batchSize: 3
            lsid: session0
            txnNumber:
              $numberLong: "1"
            startTransaction:
            autocommit: false
          command_name: find
          database_name: *database_name
      - command_started_event:
          command:
            getMore:
              $numberLong: '42'
            collection: *collection_name
            batchSize: 3
            lsid: session0
            txnNumber:
              $numberLong: "1"
            startTransaction:
            autocommit: false
          command_name: getMore
          database_name: *database_name
      - command_started_event:
          command:
            commitTransaction: 1
            lsid: session0
            txnNumber:
              $numberLong: "1"
            startTransaction:
            autocommit: false
            writeConcern:
          command_name: commitTransaction
          database_name: admin

    outcome: *outcome

  - description: aggregate

    operations:
      - *startTransaction
      - &aggregate
        name: aggregate
        object: collection
        arguments:
          pipeline:
            - $project:
                _id: 1
          batchSize: 3
          session: session0
        result: *data
      - *aggregate
      - *commitTransaction

    expectations:
      - command_started_event:
          command:
            aggregate: *collection_name
            pipeline:
              - $project:
                  _id: 1
            cursor:
              batchSize: 3
            readConcern:
            lsid: session0
            txnNumber:
              $numberLong: "1"
            startTransaction: true
            autocommit: false
          command_name: aggregate
          database_name: *database_name
      - command_started_event:
          command:
            getMore:
              # 42 is a fake placeholder value for the cursorId.
              $numberLong: '42'
            collection: *collection_name
            batchSize: 3
            lsid: session0
            txnNumber:
              $numberLong: "1"
            startTransaction:
            autocommit: false
          command_name: getMore
          database_name: *database_name
      - command_started_event:
          command:
            aggregate: *collection_name
            pipeline:
              - $project:
                  _id: 1
            cursor:
              batchSize: 3
            lsid: session0
            txnNumber:
              $numberLong: "1"
            startTransaction:
            autocommit: false
          command_name: aggregate
          database_name: *database_name
      - command_started_event:
          command:
            getMore:
              $numberLong: '42'
            collection: *collection_name
            batchSize: 3
            lsid: session0
            txnNumber:
              $numberLong: "1"
            startTransaction:
            autocommit: false
          command_name: getMore
          database_name: *database_name
      - command_started_event:
          command:
            commitTransaction: 1
            lsid: session0
            txnNumber:
              $numberLong: "1"
            startTransaction:
            autocommit: false
            writeConcern:
          command_name: commitTransaction
          database_name: admin

    outcome: *outcome

  - description: distinct

    operations:
      - *startTransaction
      - name: distinct
        object: collection
        arguments:
          session: session0
          fieldName: _id
        result: [1, 2, 3, 4]
      - *commitTransaction

    expectations:
      - command_started_event:
          command:
            distinct: *collection_name
            key: _id
            lsid: session0
            readConcern:
            txnNumber:
              $numberLong: "1"
            startTransaction: true
            autocommit: false
            writeConcern:
          command_name: distinct
          database_name: *database_name
      - command_started_event:
          command:
            commitTransaction: 1
            lsid: session0
            readConcern:
            txnNumber:
              $numberLong: "1"
            startTransaction:
            autocommit: false
            writeConcern:
          command_name: commitTransaction
          database_name: admin

    outcome: *outcome