Skip to content

Commit

Permalink
Merge pull request #49466 from linuxbox2/wip-lc-size
Browse files Browse the repository at this point in the history
rgw/notifications: fetch object state to get size, in rgw_lc.cc

Reviewed-by: Daniel Gryniewicz <dang@redhat.com>
Reviewed-by: Yuval Lifshitz <ylifshit@redhat.com>
  • Loading branch information
cbodley committed Mar 11, 2023
2 parents e64a0de + 7c58b2a commit ba99497
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/rgw/rgw_lc.cc
Expand Up @@ -539,6 +539,13 @@ static int remove_expired_obj(
}

obj = bucket->get_object(obj_key);

RGWObjState* obj_state{nullptr};
ret = obj->get_obj_state(dpp, &obj_state, null_yield, true);
if (ret < 0) {
return ret;
}

std::unique_ptr<rgw::sal::Object::DeleteOp> del_op
= obj->get_delete_op();
del_op->params.versioning_status
Expand Down Expand Up @@ -569,9 +576,9 @@ static int remove_expired_obj(
"ERROR: publishing notification failed, with error: " << ret << dendl;
} else {
// send request to notification manager
(void) notify->publish_commit(dpp, obj->get_obj_size(),
(void) notify->publish_commit(dpp, obj_state->size,
ceph::real_clock::now(),
obj->get_attrs()[RGW_ATTR_ETAG].to_str(),
obj_state->attrset[RGW_ATTR_ETAG].to_str(),
version_id);
}

Expand Down

0 comments on commit ba99497

Please sign in to comment.