diff options
author | Alex Wojno <awojno@bloomberg.net> | 2023-12-06 17:10:17 +0100 |
---|---|---|
committer | Alex Wojno <awojno@bloomberg.net> | 2023-12-20 18:23:21 +0100 |
commit | 037d7aab1de970a998111c07d82464d569800c1f (patch) | |
tree | 2caed259d943f2a49a73653806c8562836a829fb /src/rgw/driver/rados | |
parent | Merge pull request #54278 from smanjara/wip-fix-rgw-full-sync (diff) | |
download | ceph-037d7aab1de970a998111c07d82464d569800c1f.tar.xz ceph-037d7aab1de970a998111c07d82464d569800c1f.zip |
rgw/iam: fix role deletion replication
Signed-off-by: Alex Wojno <awojno@bloomberg.net>
Diffstat (limited to 'src/rgw/driver/rados')
-rw-r--r-- | src/rgw/driver/rados/rgw_sal_rados.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/rgw/driver/rados/rgw_sal_rados.cc b/src/rgw/driver/rados/rgw_sal_rados.cc index 5ede8d44fa9..e550efb8684 100644 --- a/src/rgw/driver/rados/rgw_sal_rados.cc +++ b/src/rgw/driver/rados/rgw_sal_rados.cc @@ -3677,16 +3677,18 @@ int RadosRole::delete_obj(const DoutPrefixProvider *dpp, optional_yield y) return -ERR_DELETE_CONFLICT; } - // Delete id - std::string oid = get_info_oid_prefix() + info.id; - ret = rgw_delete_system_obj(dpp, store->svc()->sysobj, pool, oid, nullptr, y); + // Delete id & insert MD Log + RGWSI_MBSObj_RemoveParams params; + std::unique_ptr<RGWSI_MetaBackend::Context> ctx(store->svc()->role->svc.meta_be->alloc_ctx()); + ctx->init(store->svc()->role->get_be_handler()); + ret = store->svc()->role->svc.meta_be->remove(ctx.get(), info.id, params, &info.objv_tracker, y, dpp); if (ret < 0) { - ldpp_dout(dpp, 0) << "ERROR: deleting role id from Role pool: " - << info.id << ": " << cpp_strerror(-ret) << dendl; + ldpp_dout(dpp, 0) << "ERROR: deleting role id: " << info.id << " failed with code: " << cpp_strerror(-ret) << dendl; + return ret; } // Delete name - oid = info.tenant + get_names_oid_prefix() + info.name; + std::string oid = info.tenant + get_names_oid_prefix() + info.name; ret = rgw_delete_system_obj(dpp, store->svc()->sysobj, pool, oid, nullptr, y); if (ret < 0) { ldpp_dout(dpp, 0) << "ERROR: deleting role name from Role pool: " |