From 0fa843cce234187ad1c18f5db1d0feab13497d73 Mon Sep 17 00:00:00 2001 From: Anuchaithra Date: Thu, 6 Mar 2025 10:36:37 +0530 Subject: [PATCH] [Tier-3]: CEPH-83572752 - RGW multisite sync Error log Signed-off-by: Anuchaithra --- .../test_sync_error_list.yaml | 5 +++ rgw/v2/tests/s3cmd/test_s3cmd.py | 31 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 rgw/v2/tests/s3cmd/multisite_configs/test_sync_error_list.yaml diff --git a/rgw/v2/tests/s3cmd/multisite_configs/test_sync_error_list.yaml b/rgw/v2/tests/s3cmd/multisite_configs/test_sync_error_list.yaml new file mode 100644 index 000000000..10de9ba77 --- /dev/null +++ b/rgw/v2/tests/s3cmd/multisite_configs/test_sync_error_list.yaml @@ -0,0 +1,5 @@ +# script: test_s3cmd.py +# polarion id: CEPH-83572752 +config: + test_ops: + sync_error_list: true diff --git a/rgw/v2/tests/s3cmd/test_s3cmd.py b/rgw/v2/tests/s3cmd/test_s3cmd.py index fc8c67ce6..b80152518 100644 --- a/rgw/v2/tests/s3cmd/test_s3cmd.py +++ b/rgw/v2/tests/s3cmd/test_s3cmd.py @@ -10,6 +10,7 @@ configs/test_disable_and_enable_dynamic_resharding_with_10k_bucket.yaml configs/test_disable_and_enable_dynamic_resharding_with_1k_bucket.yaml test_multipart_upload_with_failed_parts_using_s3cmd_and_boto3.yaml + multisite_configs/test_sync_error_list.yaml Operation: Create an user @@ -408,6 +409,36 @@ def test_exec(config, ssh_con): elif config.test_ops.get("is_not_master_zone", False): log.info("This is not the master zone. Skipping tenant user creation.") + elif config.test_ops.get("sync_error_list", False) is True: + is_multisite = utils.is_cluster_multisite() + if is_multisite: + check_sync_status = utils.exec_shell_cmd("radosgw-admin sync status") + if not check_sync_status: + raise AssertionError("Sync status output is empty") + log.info(f"sync status op is: {check_sync_status}") + if "failed" in check_sync_status or "ERROR" in check_sync_status: + log.info("sync is in error state") + if "behind" in check_sync_status or "recovering" in check_sync_status: + log.info("sync is in progress") + log.info("check cluster for sync error list") + sync_error_list = utils.exec_shell_cmd("sudo radosgw-admin sync error list") + sync_error_json = json.loads(sync_error_list) + error_exist = False + for ent in sync_error_json: + if len(ent["entries"]) != 0: + error_exist = True + break + if error_exist: + log.error( + f"To trim error manullay try running radosgw-admin sync error trim, since error could be an issue. So trim is not recommanded" + ) + log.error( + f"Post clearing sync error trim, run sync error list to verify errors are trimmed" + ) + raise AssertionError(f"Sync error data exist in cluster") + else: + log.info(f"Sync error list is empty") + else: user_name = resource_op.create_users(no_of_users_to_create=1)[0]["user_id"] tenant = "tenant"