libcephfs: Open-By-Handle API - our patch and it's description
Hi Sage,
Adam and I haven't looked in detail yet, but based on the prior email discussion, and not counting nits, Ilya's changes seem fine.
If you agree, I and Adam take on the task of rebasing all our changes currently on wip-libcephfs, into a small number of changes, following your lead in the "rebase" branch where possible. (I had some questions about how the rebase branch was assembled initially, before bugging you, we'll have a fresh look at it.) We may need some interaction on IRC, but with luck can have a prototype branch somewhere today or tomorrow. (David, Sage, wrt IRC availability, does that sound likely to work?)
Our work in progress changes logically follow all of this, so I'm not worried about those yet.
Matt
Quoted 337 lines · ----- "Sage Weil
Hi Ilya!
Quoted 5 lines · Ilya Storozhilov
Hi Matt (CC Sage, David, Adam),
we have completed with our prototype of NFS/CIFS frontends to CEPH filesystem. In order to do it we had to fork ?wip-libcephfs? branch
(see
Quoted 1 line
https://github.com/ferustigris/ceph and it?s ?open_by_handle_api?
branch) to fix
Quoted 1 line
some issues with libcephfs open-by-handle API - see below. I?ve
attached a
Quoted 1 line
respective patch, which:
I posted some comments on github on the changes. I think we're close!
Quoted 1 line
Does it possible to merge our changes to ?wip-libcephfs? branch of
the official
Quoted 1 line
CEPH repository? If some action is needed from our side (further
amendments,
Quoted 1 line
merge-requests, etc.) - let us know, please.
Matt, what is your plan for this branch? Is it/are you rebasing? Are
there other changes in progress?
I'd very much like to get the basic changes (the open by handle stuff)
into the tree during the next week or two so that we make the dumpling
release cutoff. Getting some of the additional bits that you guys specifically need ironed out (like the flushing and cap ref stuff) is less
important for that timeframe, if that helps.Ideally, the patch series would look more like the rebased version I pushed (but with updated changelogs for each patch and correct authorship/sign-off. If it's based on current master, and this patch goes
on top, I'll pull it in.It would also be great to see some tests in test/libcephfs/ for the new
calls as well... :)Quoted 1 line
There are still some unresolved issues in libcephfs, which are have
to be
Quoted 5 lines
reported:
*
A file could be manipulated by it?s resource handle (inode) even
if it has
Quoted 1 line
been already removed by another client and syncing all data in
both
Quoted 1 line
cephfs connections is not helpful in this case;If I'm understanding you, this is normal unix behavior: open, unlink, do
i/o for as long as you want, close. That is by design.Quoted 3 lines
*
Invalid hardlinks count for directories: always 1 instead of 2
plus one
Quoted 1 line
per each subdirectory as it?s dictated by POSIX.
This is a very common divergence from POSIX, and one you'll find with
btrfs and others as well. IIRC the de facto convention is that if the
link count is 1 it does not reflect the sub directory count, but if it is
Quoted 1 line
= 2 it does. You'll see code to this effect in GNU find (which tries
to
use the link count to optimize its search when -type d).Thanks!
sageQuoted 21 lines
Should we report this bugs on github?
Best regards!
--
Ilya Storozhilov
Lead Software Engineer
EPAM Systems
Tver office, Russia
GMT+4________________________________________
??: Matt W. Benjamin [[email protected]] ??????????: 6 ???? 2013 ?.21:47
To: Ilya Storozhilov
Cc: Sage Weil; aemerson; David Zafman
????: DRAFT: Re: HA: libcephfs: Open-By-Handle API questionQuoted 5 lines
Hi Ilya (CC Sage, David, Adam),
Thanks for looking at the branch.
We'll try to help you get the most out of Ganesha+Ceph, if that's
your goal.
Quoted 2 lines
I dont overly like "open-by-handle" as a descriptor for all the
changes we
Quoted 6 lines
and David Zafman have made so far, but obviously, that's a core functionality it's providing to, e.g., an NFS re-exporter.
In terms of your document,
#1 The "resource handle" vs. pointer to opaque object distinction
seems like
Quoted 1 line
a merely cosmetic change. What the API does now is typical of many C
APIs
Quoted 1 line
(see
cred_tin NetBSD kernel, many others), as well as C-over-C++APIs.
Quoted 1 line
(Perhaps this branch has actual C++ leakage, if so, it's
inadvertant, and
Quoted 3 lines
we'll fix.)
#2 The "recoverable handle" concept needs to be subordinate to the
semantics
Quoted 1 line
of the objects and capability model of Ceph. It sounds like you're
generally
Quoted 1 line
speaking about objects at the NFS protocol level. With respect to
NFS
Quoted 1 line
filehandles, everything you're asserting is already true. With
respect to
Quoted 1 line
open state and other cluster coherence concepts, you've gone past
the NFS
Quoted 1 line
protocol to details of a clustered implementation. Our team has
specific
Quoted 3 lines
requirements here that may differ from yours, just fyi.
#3, #4 I (and Adam here) aren't fully persuaded of this. While
embedding
Quoted 2 lines
objects in Ganesha handle memory would save small allocations, that may not be a critical consideration. From a Ganesha perspective,
it's
Quoted 1 line
definitely just a hidden property of the driver implementation. I
think
Quoted 1 line
intuitively we're not really keen on having Inode objects (say) be
expanded
Quoted 5 lines
in caller handles, although yes, Ganesha itself can support it.
#5 No objection here.
#6 I've been thinking of the "which level of API clients should use,
and
Quoted 1 line
which a slight modification" in more historical, and less
prescriptive
Quoted 1 line
terms. I do think it makes sense to continue refactoring to reduce
code
Quoted 1 line
duplication, in addition to getting thread-level concurrency in the
Client
Quoted 1 line
cache (that's what my api-concurrent topic branch is focused on).
Obviously,
Quoted 5 lines
we want to do this without inconveniencing other users.
Other points from your email:
The lack of a convenience function for getting the root inode is
just
Quoted 1 line
artifact of Fuse, Ganesha+Ceph, and others being able to construct
the inode
Quoted 1 line
descriptively. I don't think it's really a C++ encapsulation issue.
We can
Quoted 1 line
add an API (inline in Client) to get the root inode, however, and
will add
Quoted 3 lines
it, if there's no objection.
Getattr fixes. May not be API related. I planned to push a revision
of
Quoted 3 lines
libcephfs-wip this week, so perhaps fixes can follow this.
We haven't spent time with extended attributes so far, because
Ganesha's
Quoted 1 line
current xattr implementation is a prototype likely to change soon.
We may
Quoted 11 lines
have missed something obvious here, though, I'll look at it.
Regards,
Matt
Quoted 3 lines · ----- "Ilya Storozhilov
Hi Matt,
we have organized some testing of the open-by-handle API staff
from
Quoted 2 lines
Quoted 2 lines
the ?libcephfs-wip? Ceph repo branch and I?m sending to you our thoughts about it. I will mention inode structure as ?resource
handle?
Quoted 4 lines
Quoted 4 lines
in this letter - this is how NFS-Ganesha considers it.
First of all there is a small bug, when while trying to make file operations on the resource which has been already removed in
another
Quoted 1 line
Quoted 1 line
CephFS connection - you can even open this file for writing and
append
Quoted 1 line
Quoted 1 line
some data to it. Actually there should be a ENOENT error, but
there is
Quoted 1 line
Quoted 1 line
not. An
ceph_ll_getattr()operation returns no error on thisresource
Quoted 1 line
Quoted 1 line
handle but the amount of hard-links equals to zero in returned
stat
Quoted 8 lines
Quoted 8 lines
structure.
There is no method for listing extended attributes (e.g.
ceph_ll_listxattr()) and to lookup a root resource handle (e.g.ceph_ll_lookup_root()- it was mentioned in my previous letter).If you try to fetch an extended attribute value by calling
ceph_ll_getxattr()after setting in usingceph_ll_setxattr()youwill
Quoted 1 line
Quoted 1 line
receive a ENODATA error.
ceph_ll_removexattr()does not returnENODATA
Quoted 3 lines
Quoted 3 lines
when trying to remove non-existent extended attribute.
So at the moment we have made a draft list of key requirements to
the
Quoted 1 line
Quoted 1 line
open-by-handle CephFS API and created an API header prototype -
look
Quoted 3 lines
Quoted 3 lines
at the attached file, please. What do you think about it?
P.S. Generally speaking I think we can provide you with thepatch,
Quoted 1 line
Quoted 1 line
which fixes these issues, if you need. But mostly there will be
only
Quoted 1 line
Quoted 1 line
workarounds, cause, from my point of view a little reengineering
is
Quoted 12 lines
Quoted 12 lines
needed - see attached document.
Best regards,
Ilya________________________________________
??: Matt W. Benjamin [[email protected]]
??????????: 4 ???? 2013 ?.17:10
To: Ilya Storozhilov
Cc: [email protected]
????: Re: libcephfs: Open-By-Handle API questionQuoted 3 lines
Quoted 3 lines
Hi Ilya,
The changes on this branch originated in our Ganesha NFS driver
for
Quoted 6 lines
Quoted 6 lines
Ceph, so I'm not sure where the gap is, if any.
I'll send an update to the list when we've finish re-integrating against
the libcephfs-wip merge branch.Quoted 7 lines
Quoted 7 lines
Matt
Quoted 3 lines · ----- "Ilya Storozhilov
Hi Ceph developers,
in order to represent NFS-frontend to CephFS data storage we
are
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
trying to use innovative Open-By-Handle API from '
src/include/cephfs/libcephfs.h' file, which is of'wip-libcephfs'
Quoted 1 line
Quoted 1 line
Quoted 1 line
branch at the moment. API looks quite consistent and useful but
we
Quoted 1 line
Quoted 1 line
Quoted 1 line
couldn't find a method to get a pointer to root inode of the
mounted
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Ceph filesystem.
At the moment we have found only one place, where it could be
fetched
Quoted 2 lines
from: an 'Inode* root' member from the 'Client' class ('
src/client/Client.h') but it is in 'protected' section, sosome
Quoted 4 lines
Quoted 4 lines
hack
Quoted 1 line
is needed (e.g. to introduce a Client's descendant, which is
providing
Quoted 1 line
a method to acces this protected member). Do you know, how to
fetch
Quoted 2 lines
Quoted 2 lines
a
Quoted 1 line
pointer to the root inode of the mounted Ceph filesystem without
any
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
hacking (using just an official CephFS API only)?
Thank you and best wishes,
Ilya V. Storozhilov
EPAM Systems
Lead Software Engineer
P.S. What do you think about to make 'Open-By-Handle' API to bea
Quoted 1 line
Quoted 1 line
Quoted 1 line
primary and not low-level API to CephFS and to make POSIX-like
API
Quoted 7 lines
Quoted 7 lines
to
Quoted 2 lines
be just a helper addendum to it?--
To unsubscribe from this list: send the line "unsubscribeceph-devel"
Quoted 3 lines
in
the body of a message to [email protected] More majordomo info athttp://vger.kernel.org/majordomo-info.html
Quoted 26 lines
Quoted 7 lines
--
Matt Benjamin
The Linux Box
206 South Fifth Ave. Suite 150
Ann Arbor, MI 48104Quoted 5 lines
tel. 734-761-4689
fax. 734-769-8938
cel. 734-216-5309--
Matt Benjamin
The Linux Box
206 South Fifth Ave. Suite 150
Ann Arbor, MI 48104tel. 734-761-4689
fax. 734-769-8938
cel. 734-216-5309
Signature · 14 lines
Matt Benjamin The Linux Box 206 South Fifth Ave. Suite 150 Ann Arbor, MI 48104 http://linuxbox.com tel. 734-761-4689 fax. 734-769-8938 cel. 734-216-5309 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 5 lines · Matt W. Benjamin
Hi Sage,
Adam and I haven't looked in detail yet, but based on the prior email discussion, and not counting nits, Ilya's changes seem fine.
Quoted 7 lines
If you agree, I and Adam take on the task of rebasing all our changes currently on wip-libcephfs, into a small number of changes, following your lead in the "rebase" branch where possible. (I had some questions about how the rebase branch was assembled initially, before bugging you, we'll have a fresh look at it.) We may need some interaction on IRC, but with luck can have a prototype branch somewhere today or tomorrow. (David, Sage, wrt IRC availability, does that sound likely to work?)
I am traveling today and tomorrow, so my IRC availability will be very limited. But the rebase process I followed before is pretty straightforward. Basically,
git rebase master
git reset master
git gui
-- interactively stage various bits and pieces and commit them in
logical units
It might be simpler to just use the branch I already started and fix up the commit messages (git rebase -i master, 'e' for each commit, and git commit --amend on each to adjust the changelog).
Quoted 2 lines
Our work in progress changes logically follow all of this, so I'm not worried about those yet.
Great!
sage
Quoted 356 lines
Matt
Quoted 337 lines · ----- "Sage Weil
Hi Ilya!
Quoted 5 lines · Ilya Storozhilov
Hi Matt (CC Sage, David, Adam),
we have completed with our prototype of NFS/CIFS frontends to CEPH filesystem. In order to do it we had to fork ?wip-libcephfs? branch
(see
Quoted 1 line
https://github.com/ferustigris/ceph and it?s ?open_by_handle_api?
branch) to fix
Quoted 1 line
some issues with libcephfs open-by-handle API - see below. I?ve
attached a
Quoted 1 line
respective patch, which:
I posted some comments on github on the changes. I think we're close!
Quoted 1 line
Does it possible to merge our changes to ?wip-libcephfs? branch of
the official
Quoted 1 line
CEPH repository? If some action is needed from our side (further
amendments,
Quoted 1 line
merge-requests, etc.) - let us know, please.
Matt, what is your plan for this branch? Is it/are you rebasing? Are
there other changes in progress?
I'd very much like to get the basic changes (the open by handle stuff)
into the tree during the next week or two so that we make the dumpling
release cutoff. Getting some of the additional bits that you guys specifically need ironed out (like the flushing and cap ref stuff) is less
important for that timeframe, if that helps.Ideally, the patch series would look more like the rebased version I pushed (but with updated changelogs for each patch and correct authorship/sign-off. If it's based on current master, and this patch goes
on top, I'll pull it in.It would also be great to see some tests in test/libcephfs/ for the new
calls as well... :)Quoted 1 line
There are still some unresolved issues in libcephfs, which are have
to be
Quoted 5 lines
reported:
*
A file could be manipulated by it?s resource handle (inode) even
if it has
Quoted 1 line
been already removed by another client and syncing all data in
both
Quoted 1 line
cephfs connections is not helpful in this case;If I'm understanding you, this is normal unix behavior: open, unlink, do
i/o for as long as you want, close. That is by design.Quoted 3 lines
*
Invalid hardlinks count for directories: always 1 instead of 2
plus one
Quoted 1 line
per each subdirectory as it?s dictated by POSIX.
This is a very common divergence from POSIX, and one you'll find with
btrfs and others as well. IIRC the de facto convention is that if the
link count is 1 it does not reflect the sub directory count, but if it is
Quoted 1 line
= 2 it does. You'll see code to this effect in GNU find (which tries
to
use the link count to optimize its search when -type d).Thanks!
sageQuoted 21 lines
Should we report this bugs on github?
Best regards!
--
Ilya Storozhilov
Lead Software Engineer
EPAM Systems
Tver office, Russia
GMT+4________________________________________
??: Matt W. Benjamin [[email protected]] ??????????: 6 ???? 2013 ?.21:47
To: Ilya Storozhilov
Cc: Sage Weil; aemerson; David Zafman
????: DRAFT: Re: HA: libcephfs: Open-By-Handle API questionQuoted 5 lines
Hi Ilya (CC Sage, David, Adam),
Thanks for looking at the branch.
We'll try to help you get the most out of Ganesha+Ceph, if that's
your goal.
Quoted 2 lines
I dont overly like "open-by-handle" as a descriptor for all the
changes we
Quoted 6 lines
and David Zafman have made so far, but obviously, that's a core functionality it's providing to, e.g., an NFS re-exporter.
In terms of your document,
#1 The "resource handle" vs. pointer to opaque object distinction
seems like
Quoted 1 line
a merely cosmetic change. What the API does now is typical of many C
APIs
Quoted 1 line
(see
cred_tin NetBSD kernel, many others), as well as C-over-C++APIs.
Quoted 1 line
(Perhaps this branch has actual C++ leakage, if so, it's
inadvertant, and
Quoted 3 lines
we'll fix.)
#2 The "recoverable handle" concept needs to be subordinate to the
semantics
Quoted 1 line
of the objects and capability model of Ceph. It sounds like you're
generally
Quoted 1 line
speaking about objects at the NFS protocol level. With respect to
NFS
Quoted 1 line
filehandles, everything you're asserting is already true. With
respect to
Quoted 1 line
open state and other cluster coherence concepts, you've gone past
the NFS
Quoted 1 line
protocol to details of a clustered implementation. Our team has
specific
Quoted 3 lines
requirements here that may differ from yours, just fyi.
#3, #4 I (and Adam here) aren't fully persuaded of this. While
embedding
Quoted 2 lines
objects in Ganesha handle memory would save small allocations, that may not be a critical consideration. From a Ganesha perspective,
it's
Quoted 1 line
definitely just a hidden property of the driver implementation. I
think
Quoted 1 line
intuitively we're not really keen on having Inode objects (say) be
expanded
Quoted 5 lines
in caller handles, although yes, Ganesha itself can support it.
#5 No objection here.
#6 I've been thinking of the "which level of API clients should use,
and
Quoted 1 line
which a slight modification" in more historical, and less
prescriptive
Quoted 1 line
terms. I do think it makes sense to continue refactoring to reduce
code
Quoted 1 line
duplication, in addition to getting thread-level concurrency in the
Client
Quoted 1 line
cache (that's what my api-concurrent topic branch is focused on).
Obviously,
Quoted 5 lines
we want to do this without inconveniencing other users.
Other points from your email:
The lack of a convenience function for getting the root inode is
just
Quoted 1 line
artifact of Fuse, Ganesha+Ceph, and others being able to construct
the inode
Quoted 1 line
descriptively. I don't think it's really a C++ encapsulation issue.
We can
Quoted 1 line
add an API (inline in Client) to get the root inode, however, and
will add
Quoted 3 lines
it, if there's no objection.
Getattr fixes. May not be API related. I planned to push a revision
of
Quoted 3 lines
libcephfs-wip this week, so perhaps fixes can follow this.
We haven't spent time with extended attributes so far, because
Ganesha's
Quoted 1 line
current xattr implementation is a prototype likely to change soon.
We may
Quoted 11 lines
have missed something obvious here, though, I'll look at it.
Regards,
Matt
Quoted 3 lines · ----- "Ilya Storozhilov
Hi Matt,
we have organized some testing of the open-by-handle API staff
from
Quoted 2 lines
Quoted 2 lines
the ?libcephfs-wip? Ceph repo branch and I?m sending to you our thoughts about it. I will mention inode structure as ?resource
handle?
Quoted 4 lines
Quoted 4 lines
in this letter - this is how NFS-Ganesha considers it.
First of all there is a small bug, when while trying to make file operations on the resource which has been already removed in
another
Quoted 1 line
Quoted 1 line
CephFS connection - you can even open this file for writing and
append
Quoted 1 line
Quoted 1 line
some data to it. Actually there should be a ENOENT error, but
there is
Quoted 1 line
Quoted 1 line
not. An
ceph_ll_getattr()operation returns no error on thisresource
Quoted 1 line
Quoted 1 line
handle but the amount of hard-links equals to zero in returned
stat
Quoted 8 lines
Quoted 8 lines
structure.
There is no method for listing extended attributes (e.g.
ceph_ll_listxattr()) and to lookup a root resource handle (e.g.ceph_ll_lookup_root()- it was mentioned in my previous letter).If you try to fetch an extended attribute value by calling
ceph_ll_getxattr()after setting in usingceph_ll_setxattr()youwill
Quoted 1 line
Quoted 1 line
receive a ENODATA error.
ceph_ll_removexattr()does not returnENODATA
Quoted 3 lines
Quoted 3 lines
when trying to remove non-existent extended attribute.
So at the moment we have made a draft list of key requirements to
the
Quoted 1 line
Quoted 1 line
open-by-handle CephFS API and created an API header prototype -
look
Quoted 3 lines
Quoted 3 lines
at the attached file, please. What do you think about it?
P.S. Generally speaking I think we can provide you with thepatch,
Quoted 1 line
Quoted 1 line
which fixes these issues, if you need. But mostly there will be
only
Quoted 1 line
Quoted 1 line
workarounds, cause, from my point of view a little reengineering
is
Quoted 12 lines
Quoted 12 lines
needed - see attached document.
Best regards,
Ilya________________________________________
??: Matt W. Benjamin [[email protected]]
??????????: 4 ???? 2013 ?.17:10
To: Ilya Storozhilov
Cc: [email protected]
????: Re: libcephfs: Open-By-Handle API questionQuoted 3 lines
Quoted 3 lines
Hi Ilya,
The changes on this branch originated in our Ganesha NFS driver
for
Quoted 6 lines
Quoted 6 lines
Ceph, so I'm not sure where the gap is, if any.
I'll send an update to the list when we've finish re-integrating against
the libcephfs-wip merge branch.Quoted 7 lines
Quoted 7 lines
Matt
Quoted 3 lines · ----- "Ilya Storozhilov
Hi Ceph developers,
in order to represent NFS-frontend to CephFS data storage we
are
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
trying to use innovative Open-By-Handle API from '
src/include/cephfs/libcephfs.h' file, which is of'wip-libcephfs'
Quoted 1 line
Quoted 1 line
Quoted 1 line
branch at the moment. API looks quite consistent and useful but
we
Quoted 1 line
Quoted 1 line
Quoted 1 line
couldn't find a method to get a pointer to root inode of the
mounted
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Ceph filesystem.
At the moment we have found only one place, where it could be
fetched
Quoted 2 lines
from: an 'Inode* root' member from the 'Client' class ('
src/client/Client.h') but it is in 'protected' section, sosome
Quoted 4 lines
Quoted 4 lines
hack
Quoted 1 line
is needed (e.g. to introduce a Client's descendant, which is
providing
Quoted 1 line
a method to acces this protected member). Do you know, how to
fetch
Quoted 2 lines
Quoted 2 lines
a
Quoted 1 line
pointer to the root inode of the mounted Ceph filesystem without
any
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
hacking (using just an official CephFS API only)?
Thank you and best wishes,
Ilya V. Storozhilov
EPAM Systems
Lead Software Engineer
P.S. What do you think about to make 'Open-By-Handle' API to bea
Quoted 1 line
Quoted 1 line
Quoted 1 line
primary and not low-level API to CephFS and to make POSIX-like
API
Quoted 7 lines
Quoted 7 lines
to
Quoted 2 lines
be just a helper addendum to it?--
To unsubscribe from this list: send the line "unsubscribeceph-devel"
Quoted 3 lines
in
the body of a message to [email protected] More majordomo info athttp://vger.kernel.org/majordomo-info.html
Quoted 26 lines
Quoted 7 lines
--
Matt Benjamin
The Linux Box
206 South Fifth Ave. Suite 150
Ann Arbor, MI 48104Quoted 5 lines
tel. 734-761-4689
fax. 734-769-8938
cel. 734-216-5309--
Matt Benjamin
The Linux Box
206 South Fifth Ave. Suite 150
Ann Arbor, MI 48104tel. 734-761-4689
fax. 734-769-8938
cel. 734-216-5309Signature · 10 lines
Matt Benjamin The Linux Box 206 South Fifth Ave. Suite 150 Ann Arbor, MI 48104 http://linuxbox.com tel. 734-761-4689 fax. 734-769-8938 cel. 734-216-5309
Hi Sage,
Quoted 6 lines · ----- "Sage Weil
It might be simpler to just use the branch I already started and fix up
the commit messages (git rebase -i master, 'e' for each commit, and git
commit --amend on each to adjust the changelog).
Yes, doing exactly that.
Quoted 7 lines
Quoted 2 lines
Our work in progress changes logically follow all of this, so I'm
not
Quoted 1 line
worried about those yet.
Great!
sage
Signature · 10 lines
Matt Benjamin The Linux Box 206 South Fifth Ave. Suite 150 Ann Arbor, MI 48104 http://linuxbox.com tel. 734-761-4689 fax. 734-769-8938 cel. 734-216-5309