From 0f98740fd06b2d0c1fcd76b307b5c8720ee76e9c Mon Sep 17 00:00:00 2001 From: Soumya Koduri Date: Thu, 18 Sep 2025 17:08:48 +0530 Subject: [PATCH] rgw/restore: Fixing teuthology restore tests This includes * fixing `rgw_cloudtier.py` qa script * enabling `debug_rgw_restore` for cloud-transition suite * adding few debug statements Signed-off-by: Soumya Koduri --- qa/suites/rgw/cloud-transition/overrides.yaml | 1 + .../tasks/restore/cloud_restore_s3tests.yaml | 1 + .../transition/cloud_transition_s3tests.yaml | 1 + qa/tasks/rgw_cloudtier.py | 15 +++++++-------- src/rgw/rgw_restore.cc | 5 ++++- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/qa/suites/rgw/cloud-transition/overrides.yaml b/qa/suites/rgw/cloud-transition/overrides.yaml index 1e25002ad79..b42e092d796 100644 --- a/qa/suites/rgw/cloud-transition/overrides.yaml +++ b/qa/suites/rgw/cloud-transition/overrides.yaml @@ -5,6 +5,7 @@ overrides: setuser: ceph setgroup: ceph debug rgw: 20 + debug rgw_restore: 20 rgw crypt s3 kms backend: testing rgw crypt s3 kms encryption keys: testkey-1=YmluCmJvb3N0CmJvb3N0LWJ1aWxkCmNlcGguY29uZgo= testkey-2=aWIKTWFrZWZpbGUKbWFuCm91dApzcmMKVGVzdGluZwo= rgw crypt require ssl: false diff --git a/qa/suites/rgw/cloud-transition/tasks/restore/cloud_restore_s3tests.yaml b/qa/suites/rgw/cloud-transition/tasks/restore/cloud_restore_s3tests.yaml index 7517720c992..e3da7940734 100644 --- a/qa/suites/rgw/cloud-transition/tasks/restore/cloud_restore_s3tests.yaml +++ b/qa/suites/rgw/cloud-transition/tasks/restore/cloud_restore_s3tests.yaml @@ -7,6 +7,7 @@ tasks: client.1: port: 8001 - rgw-cloudtier: + client.1: client.0: cloud_storage_class: CLOUDTIER-CLIENT0 cloud_client: client.1 diff --git a/qa/suites/rgw/cloud-transition/tasks/transition/cloud_transition_s3tests.yaml b/qa/suites/rgw/cloud-transition/tasks/transition/cloud_transition_s3tests.yaml index 1a6c0a74f2d..d1ed911b1fb 100644 --- a/qa/suites/rgw/cloud-transition/tasks/transition/cloud_transition_s3tests.yaml +++ b/qa/suites/rgw/cloud-transition/tasks/transition/cloud_transition_s3tests.yaml @@ -11,6 +11,7 @@ tasks: #client.3: #port: 8003 - rgw-cloudtier: + client.1: client.0: # cloudtier storage class params # retain_head_object = false diff --git a/qa/tasks/rgw_cloudtier.py b/qa/tasks/rgw_cloudtier.py index dabcbd9528f..2bbc12f90b5 100644 --- a/qa/tasks/rgw_cloudtier.py +++ b/qa/tasks/rgw_cloudtier.py @@ -54,8 +54,6 @@ class RGWCloudTier(Task): clients = self.config.keys() # http://tracker.ceph.com/issues/20417 for client in clients: client_config = self.config.get(client) - if client_config is None: - client_config = {} if client_config is not None: log.info('client %s - cloudtier config is -----------------%s ', client, client_config) @@ -118,13 +116,14 @@ class RGWCloudTier(Task): log.info('Finished Configuring rgw cloudtier ...') - cluster_name, daemon_type, client_id = teuthology.split_role(client) - client_with_id = daemon_type + '.' + client_id - self.ctx.daemons.get_daemon('rgw', client_with_id, cluster_name).restart() - log.info('restarted rgw daemon ...') + for client in clients: + cluster_name, daemon_type, client_id = teuthology.split_role(client) + client_with_id = daemon_type + '.' + client_id + self.ctx.daemons.get_daemon('rgw', client_with_id, cluster_name).restart() + log.info('restarted rgw daemon ...') - (remote,) = self.ctx.cluster.only(client).remotes.keys() - wait_for_radosgw(endpoint.url(), remote) + (remote,) = self.ctx.cluster.only(client).remotes.keys() + wait_for_radosgw(endpoint.url(), remote) task = RGWCloudTier diff --git a/src/rgw/rgw_restore.cc b/src/rgw/rgw_restore.cc index 78120eba01b..8609132bf21 100644 --- a/src/rgw/rgw_restore.cc +++ b/src/rgw/rgw_restore.cc @@ -432,6 +432,7 @@ int Restore::process_restore_entry(RestoreEntry& entry, optional_yield y) return ret; } + ldpp_dout(this, 10) << "Restore:: Processing restore entry of object(" << obj->get_key() << ") entry: " << entry << dendl; target_placement.inherit_from(bucket->get_placement_rule()); auto& attrs = obj->get_attrs(); @@ -454,11 +455,13 @@ int Restore::process_restore_entry(RestoreEntry& entry, optional_yield y) attr_iter = attrs.find(RGW_ATTR_STORAGE_CLASS); if (attr_iter != attrs.end()) { target_placement.storage_class = attr_iter->second.to_str(); + } else { + ldpp_dout(this, -1) << __PRETTY_FUNCTION__ << ": ERROR: Attr RGW_ATTR_STORAGE_CLASS not found for object: " << obj->get_key() << dendl; } ret = driver->get_zone()->get_zonegroup().get_placement_tier(target_placement, &tier); if (ret < 0) { - ldpp_dout(this, -1) << __PRETTY_FUNCTION__ << ": ERROR: failed to fetch tier placement handle, ret = " << ret << dendl; + ldpp_dout(this, -1) << __PRETTY_FUNCTION__ << ": ERROR: failed to fetch tier placement handle, target_placement = " << target_placement << ", for zonegroup = " << driver->get_zone()->get_zonegroup().get_name() << ", ret = " << ret << dendl; goto done; } else { ldpp_dout(this, 20) << __PRETTY_FUNCTION__ << ": getting tier placement handle" -- 2.39.5