New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rgw/notifications: fetch object state to get size, in rgw_lc.cc #49466
Conversation
f319b41
to
31172f0
Compare
src/rgw/rgw_lc.cc
Outdated
@@ -582,7 +586,7 @@ 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(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we change this line as well to:
obj_state->attrset[RGW_ATTR_ETAG].to_str()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add that (thanks for contributing this!)
Failure to call get_obj_state() leaves object size and other members uninitialized, and appears to result in in lc delete notifications with 0 for object size. Fixes: https://tracker.ceph.com/issues/58287 Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
31172f0
to
7c58b2a
Compare
added this commit for testing: 864cf96 |
jenkins test api |
@cbodley @mattbenjamin I'd like to backport this one to Pacific as well, if there aren't any objections? I'm not interested for the sake of the notification bug, but for the fact that this change resolves another issue with index entries being left behind after all instances of objects are deleted. The case is specifically when the OLH has stale pending xattrs (that's another set of issues, but we've seen it happen very frequently in our production environments). They get left behind when ops complete abnormally. They aren't cleaned up unless there are future requests for the key. Without the [1] ceph/src/rgw/driver/rados/rgw_rados.cc Line 7484 in 0fb0dc4
|
@cfsnyder I wasn't aware of this side-effect, thanks for the detailed explanation. I have no objection to backporting. |
rgw/notifications: fetch object state to get size, in rgw_lc.cc
Failure to call get_obj_state() leaves object size and other members
uninitialized, and appears to result in in lc delete notifications
with 0 for object size.
Fixes: https://tracker.ceph.com/issues/58287
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
Checklist
Show available Jenkins commands
jenkins retest this please
jenkins test classic perf
jenkins test crimson perf
jenkins test signed
jenkins test make check
jenkins test make check arm64
jenkins test submodules
jenkins test dashboard
jenkins test dashboard cephadm
jenkins test api
jenkins test docs
jenkins render docs
jenkins test ceph-volume all
jenkins test ceph-volume tox
jenkins test windows