Hi:

        I am Mark Meyers, an independent developer in C++, and love ceph
around development so much.

        I want to ask a question about "lease issued to client".

        In ceph source, src/mds/Locker.cc <http://locker.cc>:
Locker::issue_client_lease:


        if(... &&

               (!diri->filelock.can_lease(client) &&

                (diri->get_client_cap_pending(client) &
(CEPH_CAP_FILE_SHARED | CEPH_CAP_FILE_EXCL)) == 0) &&

                 dn->lock.can_lease(client)) {

                ...

                // issue a dentry lease

               ClientLease *l = dn->add_client_lease(client, session);

                ...

                LeaseStat e;

                ...

                e.duration_ms = (int)(1000 * mdcache->client_lease_
durations[pool]);

                ...

        } else {

                // null lease

                LeaseStat e;

                ...

                e.duration_ms = 0;
                ...

        }

        So my understanding is:

        If parent directory has neither of lease or CEPH_CAP_FILE_SHARED
mask, then the dentry can get a lease of 30s(caculated from duration_ms).

        Else if in other conditions, then the dentry get a lease of 0s.

        I am confused here, in what situation does the parent directory and
the child dentry share a lease?

        And in what situation does the child dentry have no lease(lease of
zero seconds?)?

        Could you please explain it further?


Thanks for your reading, I really appreciate your response. Thanks.


------------------------------

Mark Meyers

>From Ceph Community.
_______________________________________________
ceph-users mailing list
[email protected]
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com

Reply via email to