]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw: in ordered bucket listing skip namespaced entries when possible 38493/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Fri, 4 Dec 2020 23:16:08 +0000 (18:16 -0500)
committerJ. Eric Ivancich <ivancich@redhat.com>
Wed, 9 Dec 2020 15:22:29 +0000 (10:22 -0500)
commit94f46f6db0b4d888dd1804328314e811efc1736c
tree33dead1523e6f5f30b93d89da17e2bf01c27647f
parent113c464360ba2b5e92399525bd74abacaafcabb2
rgw: in ordered bucket listing skip namespaced entries when possible

When listing non-namespaced entries in the bucket index, the code
would march through the namespaced entries in blocks, requesting all
of them from the CLS layer. When there were many namespaced entries,
it would significantly affect the performance of ordered listing.

This commit adds code to advance the marker passed to lower layers to
skip past namespaced entries. This is challenging in that
non-namespaced entries can appear in the middle of the namespaced
entries. We'll ignore the issue instance tags in names to simplify the
following discussion. Non-namespaced entries are indexed by
"name". Namespaced entries are indexed by _namespace_name, using
underscores to surround the namespace. The challenge comes with
entries such as "_name", where the name begins with an underscore. In
that case we index them by "__name", quoting the underscore with
another.

Now the extra challenge comes due to the lexic ordering of the
following:

    ASP
    _BAT_cat
    __DOG
    _eel_FOX
    goat

Note that the namespaced entries are in positions 2 and 4, and the
non-namespaced entries are in positions 1, 3, and 5. So when skipping
past the namespaced entries, we have to be careful not to skip past
the non-namespaced entries that begin with underscore.

Additional code clean-ups done as well.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
Resolves: rhbz#1883283
(cherry picked from commit acfa6409597768b3c1dc8dcab3668d23761a4cbc)
src/cls/rgw/cls_rgw_types.h
src/rgw/rgw_common.h
src/rgw/rgw_rados.cc