Re: question about snapset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2 Feb 2017, sheng qiu wrote:
> Hi cephers,
> 
> We are reading the codes of Ceph I/O path. We found within the
> do_op(), it tries to get the object context each time as well as the
> snapset context.
> 
> may i ask what's the usage of the snapset context and what's the
> relationship between snapset context and the individual object? Does
> each object has a snapset context ? Does it stores as attribute within
> the onode that associated with the object?
> i read some articles said only head object has snapset context, may i
> ask what's the head object and what's the relationship between a head
> object and other non-head objects?

A given logical object may be contained by several snapshots, and we'll 
have a separate clone for each unique version of the object. The 
head (snapid == CEPH_NOSNAP) is the latest read/write version of the 
object.  A clone (snapid < CEPH_NOSNAP) is the version for some number of 
snapshots.  For example, if you wrote X, took snapshot 1, write X', wrote 
X'', took snap 2, took snap 3, then wrote X''', you'd have 3 clones with 
something like

X    (snapid 1) snaps=[1]
X''  (snapid 3) snaps=[2,3]
X''' (head) clones=[1,2]

The SnapSet is attached to the head and tells us we have 2 clones (1 and 
3).  Each clone has a snaps vector that tells us which snaps it exists in.  
There's some other bookkeeping in SnapSet as well that tells us what data 
extents are identical across adjacent clones (so that they can share 
blocks on disk efficiently).

There's one annoying oddity that if the head doesn't logically exist we 
create an object with snapid CEPH_SNAPDIR and attach the SnapSet to 
that.  We hope to remove this soon (by storing SnapSet on head and marking 
head as a whiteout) as it complicates the code.

Hope that helps!
sage
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux