Skip to content

PBM-1223 load test

PBM-1223 load test #89

GitHub Actions / JUnit Test Report failed Feb 29, 2024 in 0s

15 tests run, 13 passed, 0 skipped, 2 failed.

Annotations

Check failure on line 82 in pbm-functional/pytest/test_PBM-1223.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_PBM-1223.test_logical

AssertionError: Starting restore 2024-02-29T08:16:37.399015761Z from '2024-02-29T08:16:11Z'...Started logical restore.
Waiting to finish...Error: operation failed with: reply oplog: replay chunk 1709194572.1709194575: apply oplog for chunk: applying a transaction entry: apply txn: {
 "Timestamp": {
  "T": 1709194572,
  "I": 12
 },
 "Term": 1,
 "Hash": null,
 "Version": 2,
 "Operation": "c",
 "Namespace": "admin.$cmd",
 "Object": [
  {
   "Key": "commitTransaction",
   "Value": 1
  },
  {
   "Key": "commitTimestamp",
   "Value": {
    "T": 1709194572,
    "I": 10
   }
  }
 ],
 "Query": null,
 "UI": null,
 "LSID": "SAAAAAVpZAAQAAAABK/PNjJlf0ZCp11Wq4dE62EFdWlkACAAAAAAY5mrDaxi8gv8RmdTsQ+1j7fmkr7JUsabhNmXAheU0fgA",
 "TxnNumber": 1,
 "PrevOpTime": "HAAAABF0cwAKAAAATD3gZRJ0AAEAAAAAAAAAAA=="
}: unknown transaction id SAAAAAVpZAAQAAAABK/PNjJlf0ZCp11Wq4dE62EFdWlkACAAAAAAY5mrDaxi8gv8RmdTsQ+1j7fmkr7JUsabhNmXAheU0fgA-1
Raw output
start_cluster = True, cluster = <cluster.Cluster object at 0x7f8ef65228d0>

    @pytest.mark.testcase(test_case_key="T249", test_step_key=1)
    @pytest.mark.timeout(300,func_only=True)
    def test_logical(start_cluster,cluster):
        cluster.check_pbm_status()
        client = pymongo.MongoClient(cluster.connection)
        db = client.test
        collection = db.test
        with client.start_session() as session:
            with session.start_transaction():
                Cluster.log("Transaction started\n")
                collection.insert_one({"e": 5}, session=session)
                collection.insert_one({"f": 6}, session=session)
                collection.insert_one({"g": 7}, session=session)
                collection.insert_one({"h": 8}, session=session)
                collection.insert_one({"i": 9}, session=session)
                background_backup=concurrent.futures.ThreadPoolExecutor().submit(cluster.make_backup, 'logical')
                time.sleep(1)
                collection.insert_one({"j": 10}, session=session)
                collection.insert_one({"k": 11}, session=session)
                collection.insert_one({"l": 12}, session=session)
                session.commit_transaction()
                Cluster.log("Transaction commited\n")
        backup=background_backup.result()
        assert pymongo.MongoClient(cluster.connection)["test"]["test"].count_documents({}) == 8
>       cluster.make_restore(backup,check_pbm_status=True)

test_PBM-1223.py:82: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <cluster.Cluster object at 0x7f8ef65228d0>, name = '2024-02-29T08:16:11Z'
kwargs = {'check_pbm_status': True}
client = MongoClient(host=['mongos:27017'], document_class=dict, tz_aware=False, connect=True)
result = CommandResult(backend=<testinfra.backend.docker.DockerBackend object at 0x7f8ef6355e90>, exit_status=1, command=b'time... id SAAAAAVpZAAQAAAABK/PNjJlf0ZCp11Wq4dE62EFdWlkACAAAAAAY5mrDaxi8gv8RmdTsQ+1j7fmkr7JUsabhNmXAheU0fgA-1\n', _stderr=b'')
n = <testinfra.host.Host docker://rscfg01>, timeout = 240

    def make_restore(self, name, **kwargs):
        if self.layout == "sharded":
            client = pymongo.MongoClient(self.connection)
            result = client.admin.command("balancerStop")
            client.close()
            Cluster.log("Stopping balancer: " + str(result))
            self.stop_mongos()
        self.stop_arbiters()
        n = testinfra.get_host("docker://" + self.pbm_cli)
        timeout = time.time() + 60
    
        while True:
            if not self.get_status()['running']:
                break
            if time.time() > timeout:
                assert False, "Cannot start restore, another operation running"
            time.sleep(1)
        Cluster.log("Restore started")
        timeout=kwargs.get('timeout', 240)
        result = n.run('timeout ' + str(timeout) + ' pbm restore ' + name + ' --wait')
        if result.rc == 124:
            # try to catch possible failures if timeout exceeded
            for host in self.mongod_hosts:
                try:
                    container = docker.from_env().containers.get(host)
                    get_logs = container.exec_run(
                        'cat /var/lib/mongo/pbm.restore.log', stderr=False)
                    if get_logs.exit_code == 0:
                        Cluster.log(
                            "!!!!Possible failure on {}, file pbm.restore.log was found:".format(host))
                        Cluster.log(get_logs.output.decode('utf-8'))
                except docker.errors.APIError:
                    pass
            assert False, "Timeout for restore exceeded"
        elif result.rc == 0:
            Cluster.log(result.stdout)
        else:
>           assert False, result.stdout + result.stderr
E           AssertionError: Starting restore 2024-02-29T08:16:37.399015761Z from '2024-02-29T08:16:11Z'...Started logical restore.
E           Waiting to finish...Error: operation failed with: reply oplog: replay chunk 1709194572.1709194575: apply oplog for chunk: applying a transaction entry: apply txn: {
E            "Timestamp": {
E             "T": 1709194572,
E             "I": 12
E            },
E            "Term": 1,
E            "Hash": null,
E            "Version": 2,
E            "Operation": "c",
E            "Namespace": "admin.$cmd",
E            "Object": [
E             {
E              "Key": "commitTransaction",
E              "Value": 1
E             },
E             {
E              "Key": "commitTimestamp",
E              "Value": {
E               "T": 1709194572,
E               "I": 10
E              }
E             }
E            ],
E            "Query": null,
E            "UI": null,
E            "LSID": "SAAAAAVpZAAQAAAABK/PNjJlf0ZCp11Wq4dE62EFdWlkACAAAAAAY5mrDaxi8gv8RmdTsQ+1j7fmkr7JUsabhNmXAheU0fgA",
E            "TxnNumber": 1,
E            "PrevOpTime": "HAAAABF0cwAKAAAATD3gZRJ0AAEAAAAAAAAAAA=="
E           }: unknown transaction id SAAAAAVpZAAQAAAABK/PNjJlf0ZCp11Wq4dE62EFdWlkACAAAAAAY5mrDaxi8gv8RmdTsQ+1j7fmkr7JUsabhNmXAheU0fgA-1

cluster.py:451: AssertionError

Check failure on line 58 in pbm-functional/pytest/test_upgrade.py

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

test_upgrade.test_logical

AssertionError: Starting restore 2024-02-29T08:48:30.930167899Z from '2024-02-29T08:47:53Z'..Error: waiting for start: cluster failed: failed to ensure oplog file 2024-02-29T08:47:53Z/rs1/oplog: no such file
- Restore on replicaset "rs2" in state: error: failed to ensure oplog file 2024-02-29T08:47:53Z/rs2/oplog: no such file
- Restore on replicaset "rs1" in state: error: failed to ensure oplog file 2024-02-29T08:47:53Z/rs1/oplog: no such file
Raw output
start_cluster = True, cluster = <cluster.Cluster object at 0x7f8eeb8fb2d0>

    @pytest.mark.timeout(600,func_only=True)
    def test_logical(start_cluster,cluster):
        cluster.check_pbm_status()
        pymongo.MongoClient(cluster.connection)["test"]["test"].insert_many(documents)
        backup=cluster.make_backup("logical")
        result=pymongo.MongoClient(cluster.connection)["test"]["test"].delete_many({})
        assert int(result.deleted_count) == len(documents)
        cluster.upgrade()
        cluster.check_pbm_status()
>       cluster.make_restore(backup,check_pbm_status=True)

test_upgrade.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <cluster.Cluster object at 0x7f8eeb8fb2d0>, name = '2024-02-29T08:47:53Z'
kwargs = {'check_pbm_status': True}
client = MongoClient(host=['mongos:27017'], document_class=dict, tz_aware=False, connect=True)
result = CommandResult(backend=<testinfra.backend.docker.DockerBackend object at 0x7f8ef6355e90>, exit_status=1, command=b'time...store on replicaset "rs1" in state: error: failed to ensure oplog file 2024-02-29T08:47:53Z/rs1/oplog: no such file\n')
n = <testinfra.host.Host docker://rscfg01>, timeout = 240

    def make_restore(self, name, **kwargs):
        if self.layout == "sharded":
            client = pymongo.MongoClient(self.connection)
            result = client.admin.command("balancerStop")
            client.close()
            Cluster.log("Stopping balancer: " + str(result))
            self.stop_mongos()
        self.stop_arbiters()
        n = testinfra.get_host("docker://" + self.pbm_cli)
        timeout = time.time() + 60
    
        while True:
            if not self.get_status()['running']:
                break
            if time.time() > timeout:
                assert False, "Cannot start restore, another operation running"
            time.sleep(1)
        Cluster.log("Restore started")
        timeout=kwargs.get('timeout', 240)
        result = n.run('timeout ' + str(timeout) + ' pbm restore ' + name + ' --wait')
        if result.rc == 124:
            # try to catch possible failures if timeout exceeded
            for host in self.mongod_hosts:
                try:
                    container = docker.from_env().containers.get(host)
                    get_logs = container.exec_run(
                        'cat /var/lib/mongo/pbm.restore.log', stderr=False)
                    if get_logs.exit_code == 0:
                        Cluster.log(
                            "!!!!Possible failure on {}, file pbm.restore.log was found:".format(host))
                        Cluster.log(get_logs.output.decode('utf-8'))
                except docker.errors.APIError:
                    pass
            assert False, "Timeout for restore exceeded"
        elif result.rc == 0:
            Cluster.log(result.stdout)
        else:
>           assert False, result.stdout + result.stderr
E           AssertionError: Starting restore 2024-02-29T08:48:30.930167899Z from '2024-02-29T08:47:53Z'..Error: waiting for start: cluster failed: failed to ensure oplog file 2024-02-29T08:47:53Z/rs1/oplog: no such file
E           - Restore on replicaset "rs2" in state: error: failed to ensure oplog file 2024-02-29T08:47:53Z/rs2/oplog: no such file
E           - Restore on replicaset "rs1" in state: error: failed to ensure oplog file 2024-02-29T08:47:53Z/rs1/oplog: no such file

cluster.py:451: AssertionError