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
Problem: 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.
Solution: To avoid the situation, guarded the addb.set_id() call by checking
  if we have the req_state ptr accesible and generated the unique req_id
  per delete obj request.

Signed-off-by: Sumedh Anantrao Kulkarni <sumedh.a.kulkarni@seagate.com>
  • Loading branch information
sumedhak27 authored and Sachin Punadikar committed Sep 14, 2022
1 parent 94c56d0 commit 8f45d92
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/rgw/rgw_sal_motr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2071,7 +2071,17 @@ 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, we are generating a new req_id per obj deletion operation.
// This will retrict us from traking all delete req per user_remove req in ADDB
// untill we make changes to access req_state without using RGWObjectCtx ptr.

if (rctx->get_private()) {
addb_logger.set_id(rctx);
} else {
addb_logger.set_id(_source->store->get_new_req_id());
}
}

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

0 comments on commit 8f45d92

Please sign in to comment.