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

librados: remove legacy object listing API, clean up newer api #13149

Merged
merged 7 commits into from Feb 14, 2017

Conversation

liewegas
Copy link
Member

@liewegas liewegas commented Jan 27, 2017

Also add some minimal documentation for the new and preferred API.

This adventure began by trying to clean up the internal Objecter list_nobjects() code, but in the end I ended up deprecating it (and removing the older legacy interface entirely). I'm not sure it's worth the churn on that code at all, given that all users should be moving to the new enumeration code anyway. Should I just drop that patch?

/**
* @warning Deprecated: Use rados_nobjects_list_open() instead
*/
CEPH_RADOS_API int rados_objects_list_open(rados_ioctx_t io,
Copy link
Contributor

Choose a reason for hiding this comment

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

we are removing APIs from librados, so shall we take this chance to consider http://pad.ceph.com/p/librados3?

Copy link
Member

Choose a reason for hiding this comment

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

thought we talked about making these return -ENOTSUPP instead?

@jdurgin
Copy link
Member

jdurgin commented Jan 28, 2017

as a follow-on we should switch rados.pyx's ObjectIterator to use the cursor methods too - it uses the nobjects api

@liewegas
Copy link
Member Author

liewegas commented Jan 30, 2017 via email

@liewegas
Copy link
Member Author

liewegas commented Jan 30, 2017 via email

ldout(cct, 10) << " hobject sort order changed, restarting this pg"
<< dendl;
list_context->cookie = collection_list_handle_t();
list_context->pos = hobject_t(
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't snapid be 0 for the min hobject_t() here and a couple places you construct hobject_t with CEPH_NOSNAP (-2)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm.. possibly. It would only matter if you set the ioctx read snapid. The code to support this in the OSD is very slow (we have to load the object_info_t for the head and the relevant clone), so I'm wonder if we want to remove support for it altogether.

In the meantime, I guess we should just use the read snap id here?

Copy link
Member Author

Choose a reason for hiding this comment

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

actually, looking at this more closely, the list_nobjects() Objecter interface doesn't have a way to specify a snap and never has. So CEPH_NOSNAP is correct in this case. If we wanted to change the API to support listing a snap we could (and IIRC there have been PRs in the past to do this) but until that happens i'm pretty sure NOSNAP is the right thing. In particular, the arg is "start after", and we give it the last item we got before, so we want it to be == (not <) that previous item.. if we change to 0 here i think we'll get dups on the request boundaries.

@liewegas liewegas changed the title librados: remove legacy object listing API; deprecate slightly less legacy API librados: remove legacy object listing API Feb 2, 2017
@liewegas liewegas changed the title librados: remove legacy object listing API librados: remove legacy object listing API, clean up newer api Feb 2, 2017
@liewegas
Copy link
Member Author

liewegas commented Feb 3, 2017

retest this please

@@ -61,15 +61,6 @@ set_target_properties(ceph_test_rados_api_list PROPERTIES COMPILE_FLAGS
target_link_libraries(ceph_test_rados_api_list
rados_a global ${UNITTEST_LIBS} radostest)

# ceph_test_rados_api_nlist
Copy link
Member

Choose a reason for hiding this comment

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

@liewegas shouldn't remove this test

@liewegas
Copy link
Member Author

liewegas commented Feb 7, 2017 via email

@yehudasa
Copy link
Member

yehudasa commented Feb 7, 2017

@liewegas oic, will need to merge my new tests into _list

@liewegas
Copy link
Member Author

liewegas commented Feb 9, 2017

Stop using current_pg as a position pointer; use the hobject_t
cursor explicitly.

We keep current_pg *only* for compatibility with !sortbitwise
clusters, and we only use it when we get back MAX from a
!sortbitwise OSD and need to determine where the start of the next
PG is.  In !sortbitwise mode we also have the legacy kludges to
behave on PG split.

Signed-off-by: Sage Weil <sage@redhat.com>
Yes, we send an extra 4 bytes per entry for the namespace, but
who cares; this reduces the amount of code we need to maintain.

Signed-off-by: Sage Weil <sage@redhat.com>
This is means we don't know how to list objects on pre-hammer OSDs.
(The PGNLS op was added around a03f85a

Signed-off-by: Sage Weil <sage@redhat.com>
These have been deprecated since giant.

Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
@liewegas liewegas merged commit 20809f0 into ceph:master Feb 14, 2017
@liewegas liewegas deleted the wip-list-objects branch February 14, 2017 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants