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)