Skip to content
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: fix handling of ENOENT in RGWRadosGetOmapKeysCR #19878

Merged
merged 2 commits into from Jan 16, 2018

Conversation

cbodley
Copy link
Contributor

@cbodley cbodley commented Jan 9, 2018

when this operates on a nonexistent object, the osd will reject the request with ENOENT before trying to process the subops. so Objecter will get back a subop return code of 0, try to decode an empty bufferlist into the result and map that subop return code to EIO. by using the AioCompletion's return code, we get the correct result of ENOENT instead

separately, it now calls omap_get_keys2() instead of omap_get_vals2(), and uses set<string> instead of map<string, bufferlist> accordingly

when this operates on a nonexistent object, the osd will reject the
request with ENOENT before trying to process the subops. so Objecter
will get back a subop return code of 0, try to decode an empty
bufferlist into the result and map that subop return code to EIO

by using the AioCompletion's return code, we get the correct result of
ENOENT instead

Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Copy link
Contributor

@adamemerson adamemerson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Life gets tough, man!

{
int r = cn->completion()->get_return_value();

set_status() << "request complete; ret=" << r;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I have searched aio_operate in RGW code to check whether there is similar problem. It seems that all async rados CR(RGWRadosSetOmapKeysCR, RGWRadosRemoveOmapKeysCR, RGWRadosRemoveCR, RGWRadosBILogTrimCR) already use cn->completion()->get_return_value().

maybe we should create a base class, avoid those duplicated code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should create a base class, avoid those duplicated code?

that sounds reasonable, yeah. it would help distinguish the ops that use aio_operate vs async_rados

@yuriw
Copy link
Contributor

yuriw commented Jan 10, 2018

@yuriw yuriw merged commit afb35ba into ceph:master Jan 16, 2018
@cbodley cbodley deleted the wip-rgw-get-omap-keys-cr branch January 17, 2018 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants