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

Commit 8f45d92

Browse files
sumedhak27Sachin Punadikar
authored andcommitted
rgw_sal_motr: [CORTX-32697] support user remove with purge data
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 <[email protected]>
1 parent 94c56d0 commit 8f45d92

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/rgw/rgw_sal_motr.cc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2071,7 +2071,17 @@ MotrObject::MotrDeleteOp::MotrDeleteOp(MotrObject *_source, RGWObjectCtx *_rctx)
20712071
source(_source),
20722072
rctx(_rctx)
20732073
{
2074-
addb_logger.set_id(rctx);
2074+
// - In case of the operation remove_user with --purge-data, we don't
2075+
// have access to the `req_state* s` via `RGWObjectCtx* rctx`.
2076+
// - In this case, we are generating a new req_id per obj deletion operation.
2077+
// This will retrict us from traking all delete req per user_remove req in ADDB
2078+
// untill we make changes to access req_state without using RGWObjectCtx ptr.
2079+
2080+
if (rctx->get_private()) {
2081+
addb_logger.set_id(rctx);
2082+
} else {
2083+
addb_logger.set_id(_source->store->get_new_req_id());
2084+
}
20752085
}
20762086

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

0 commit comments

Comments
 (0)