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

Projects
None yet
4 participants
@liewegas
Member

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,

This comment has been minimized.

@tchaikov

tchaikov Jan 27, 2017

Contributor

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

This comment has been minimized.

@jdurgin

jdurgin Jan 28, 2017

Member

thought we talked about making these return -ENOTSUPP instead?

@jdurgin

This comment has been minimized.

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

This comment has been minimized.

Member

liewegas commented Jan 30, 2017

@liewegas

This comment has been minimized.

Member

liewegas commented Jan 30, 2017

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

This comment has been minimized.

@jdurgin

jdurgin Jan 30, 2017

Member

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

This comment has been minimized.

@liewegas

liewegas Jan 31, 2017

Member

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?

This comment has been minimized.

@liewegas

liewegas Jan 31, 2017

Member

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 from librados: remove legacy object listing API; deprecate slightly less legacy API to librados: remove legacy object listing API Feb 2, 2017

@liewegas liewegas changed the title from librados: remove legacy object listing API to librados: remove legacy object listing API, clean up newer api Feb 2, 2017

@liewegas

This comment has been minimized.

Member

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

This comment has been minimized.

@yehudasa

yehudasa Feb 7, 2017

Member

@liewegas shouldn't remove this test

@liewegas

This comment has been minimized.

Member

liewegas commented Feb 7, 2017

@yehudasa

This comment has been minimized.

Member

yehudasa commented Feb 7, 2017

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

@liewegas

This comment has been minimized.

liewegas added some commits Jan 26, 2017

osdc/Objecter: refactor list_nobjects to use hobject_t as position
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>
librados: use new PGNLS even for legacy list API
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>
librados: remove deprecated object listing interfaces
These have been deprecated since giant.

Signed-off-by: Sage Weil <sage@redhat.com>
osdc/Objecter: remove unused list_objects implementation
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>
librados: document new object enumeration methods
Signed-off-by: Sage Weil <sage@redhat.com>
librados: keep v1 stubs to preserve ABI
Signed-off-by: Sage Weil <sage@redhat.com>
PendingReleaseNotes: notes about object listing API removal
Signed-off-by: Sage Weil <sage@redhat.com>

@liewegas liewegas merged commit 20809f0 into ceph:master Feb 14, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details

@liewegas liewegas deleted the liewegas:wip-list-objects branch Feb 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment