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: resolve empty ordered bucket listing results w/ CLS filtering #42125

Merged
merged 3 commits into from Aug 5, 2021

Conversation

ivancich
Copy link
Member

@ivancich ivancich commented Jul 1, 2021

rgw: resolve empty ordered bucket listing results w/ CLS filtering

Bucket listing filtering was moved from the RGW lyer to the CLS layer to improve efficiency. However currently if there are enough entries that are filtered out, the CLS call may return zero entries back to RGW. Since we did not mark how far we got, calling it again will yield the same result, causing the process to be stuck and fail.

This solution adds a marker to the CLS call's return object to RGW. That will allow the next call to pick up where it left off.

Because the bucket index is spread across many shards, the CLSRGWConcurrentIO class is used to coordinate these asynchronous calls. Functionality is added to this class to handle re-issuing the call with the new marker to make sure at least one entry is returned.

Fixes: https://tracker.ceph.com/issues/51462
Signed-off-by: J. Eric Ivancich ivancich@redhat.com

@ivancich ivancich force-pushed the wip-cls-empty-listing branch 8 times, most recently from aeb961a to 098819d Compare July 20, 2021 01:02
@ivancich ivancich force-pushed the wip-cls-empty-listing branch 2 times, most recently from 9ed02db to a12389e Compare July 21, 2021 19:49
@ivancich ivancich added needs-review and removed DNM labels Jul 27, 2021
@github-actions
Copy link

github-actions bot commented Aug 2, 2021

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

src/cls/rgw/cls_rgw_client.h Outdated Show resolved Hide resolved
src/cls/rgw/cls_rgw_client.h Outdated Show resolved Hide resolved
src/cls/rgw/cls_rgw_client.h Outdated Show resolved Hide resolved
src/cls/rgw/cls_rgw_client.cc Outdated Show resolved Hide resolved
When using asynchronous (concurrent) IO for bucket index requests,
there are two int ids that are used that need to be kept separate --
shard id and request id. In many cases they're the same -- shard 0
gets request 0, and so forth.

But in preparation for re-requests, those ids can diverge, where
request 13 maps to shard 2. The existing code maintained the OIDs that
went with each request. This PR also maintains the shard id as
well. Documentation has been beefed up to help future developers
navigate this.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
When doing an asynchronous/concurrent bucket index operation against
multiple bucket index shards, a special error code is set aside to
indicate that an "advancing" retry of a/some shard(s) is necessary. In
that case another asynchronous call is made on the indicated shard(s)
from the client (i.e., CLSRGWConcurrentIO).  It is up to the subclass
of CLSRGWConcurrentIO to handle the retry such that it "advances" and
simply doesn't get stuck, looping forever.

The retry functionality only works when the "need_multiple_rounds"
functionality is not in use.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
A previous PR moved the much of the filtering that's part of bucket
listing to the CLS layer. One unanticipated result was that it is now
possible for a call to return 0 entries. In such a case we want to
retry the call with the marker moved forward (i.e., advanced),
repeatedly if necessary, in order to either retrieve some entries or
to hit the end of the entries. This PR adds that functionality.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
@cbodley
Copy link
Contributor

cbodley commented Aug 5, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants