Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
rgw_sal_motr: [CORTX-32697] support user remove with purge data
Browse files Browse the repository at this point in the history
During Remove User code-flow till the DeleteOp is instantiated for
each obj from a bucket, we don't have the access to req_state ptr
via RGWObjectCtx. This causes the addb.set_id(rctx) to fail, as it
tries to access the req_id from null req_state ptr.
To avoid the situation, guarded the addb.set_id() call by checking
if we have the req_state ptr accesible.

Signed-off-by: Sumedh Anantrao Kulkarni <sumedh.a.kulkarni@seagate.com>
  • Loading branch information
sumedhak27 committed Sep 13, 2022
1 parent 94c56d0 commit cbfa323
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rgw/rgw_sal_motr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2071,7 +2071,11 @@ MotrObject::MotrDeleteOp::MotrDeleteOp(MotrObject *_source, RGWObjectCtx *_rctx)
source(_source),
rctx(_rctx)
{
addb_logger.set_id(rctx);
// In case of the operation remove_user with --purge-data, we don't
// have access to the `req_state* s` via `RGWObjectCtx* rctx`.
// In this case ,the req_id for addb_logger will have a default value.
if (rctx->get_private())
addb_logger.set_id(rctx);
}

// Implementation of DELETE OBJ also requires MotrObject::get_obj_state()
Expand Down

0 comments on commit cbfa323

Please sign in to comment.